Skip to content

Commit 5f80a6e

Browse files
committed
Fix null exception in setting change detection
Since `cwd` can be `undefined` we need to use optional chaining.
1 parent 14c7d4a commit 5f80a6e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/session.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,8 @@ export class SessionManager implements Middleware {
424424

425425
// Detect any setting changes that would affect the session
426426
if (!this.suppressRestartPrompt &&
427-
(settings.cwd.toLowerCase() !==
428-
this.sessionSettings.cwd.toLowerCase() ||
427+
(settings.cwd?.toLowerCase() !==
428+
this.sessionSettings.cwd?.toLowerCase() ||
429429
settings.powerShellDefaultVersion.toLowerCase() !==
430430
this.sessionSettings.powerShellDefaultVersion.toLowerCase() ||
431431
settings.developer.editorServicesLogLevel.toLowerCase() !==

0 commit comments

Comments
 (0)