-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: crash when url is undefined #954
fix: crash when url is undefined #954
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@GustavEikaas Build is failing. Can you please fix and update the PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build failed
@msivasubramaniaan Linting fixed ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does this PR do?
When the url property in the schema store is undefined the program crashes. It should also be considered adding some useful logging. Enabling schemastore without an url doesnt seem to do much.
What issues does this PR fix or reference?
I couldnt find any issues referencing this. I can make one if thats wanted
Is it tested? How?
Tested it locally. Try installing the package and running it with yaml.schemastore.enabled = true without specifying an url. After adding the
?
it wont crash anymoreStacktrace
setConfiguration
[ERROR][2024-03-15 22:13:53] ...lsp/handlers.lua:535 "TypeError: Cannot read properties of undefined (reading 'length')\n at SettingsHandler.setConfiguration (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\yaml-language-server\\out\\server\\src\\languageserver\\handlers\\settingsHandlers.js:80:43)\n at SettingsHandler.pullConfiguration (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\yaml-language-server\\out\\server\\src\\languageserver\\handlers\\settingsHandlers.js:58:16)"
setSchemaStoreSettingsIfNotSet
[ERROR][2024-03-15 22:29:16] ...lsp/handlers.lua:535 "TypeError: Cannot read properties of undefined (reading 'length')\n at SettingsHandler.setSchemaStoreSettingsIfNotSet (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\yaml-language-server\\out\\server\\src\\languageserver\\handlers\\settingsHandlers.js:166:42)\n at SettingsHandler.setConfiguration (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\yaml-language-server\\out\\server\\src\\languageserver\\handlers\\settingsHandlers.js:135:16)\n at SettingsHandler.pullConfiguration (C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\yaml-language-server\\out\\server\\src\\languageserver\\handlers\\settingsHandlers.js:58:16)"