Skip to content

Commit 7203630

Browse files
fix: crash when url is undefined (#954)
* fix: crash when url is undefined * add another null check * style: prettier fix --------- Co-authored-by: Muthurajan Sivasubramanian <[email protected]>
1 parent 0871dc1 commit 7203630

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/languageserver/handlers/settingsHandlers.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class SettingsHandler {
8181

8282
if (settings.yaml.schemaStore) {
8383
this.yamlSettings.schemaStoreEnabled = settings.yaml.schemaStore.enable;
84-
if (settings.yaml.schemaStore.url.length !== 0) {
84+
if (settings.yaml.schemaStore.url?.length !== 0) {
8585
this.yamlSettings.schemaStoreUrl = settings.yaml.schemaStore.url;
8686
}
8787
}
@@ -180,7 +180,7 @@ export class SettingsHandler {
180180
private async setSchemaStoreSettingsIfNotSet(): Promise<void> {
181181
const schemaStoreIsSet = this.yamlSettings.schemaStoreSettings.length !== 0;
182182
let schemaStoreUrl = '';
183-
if (this.yamlSettings.schemaStoreUrl.length !== 0) {
183+
if (this.yamlSettings.schemaStoreUrl?.length !== 0) {
184184
schemaStoreUrl = this.yamlSettings.schemaStoreUrl;
185185
} else {
186186
schemaStoreUrl = JSON_SCHEMASTORE_URL;

0 commit comments

Comments
 (0)