Skip to content

Commit 3c5e517

Browse files
committed
Fix TypeScript null safety for client notifications
1 parent 93994e1 commit 3c5e517

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

VSCode/vscode-extension/src/extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ async function startLanguageServer(context: vscode.ExtensionContext): Promise<vo
580580
if (e.affectsConfiguration('strideShaderTools.shaderPaths')) {
581581
const updatedConfig = vscode.workspace.getConfiguration('strideShaderTools');
582582
const paths = updatedConfig.get<string[]>('shaderPaths') ?? [];
583-
client.sendNotification('stride/updateShaderPaths', {
583+
client?.sendNotification('stride/updateShaderPaths', {
584584
additionalShaderPaths: paths,
585585
});
586586
}
@@ -590,7 +590,7 @@ async function startLanguageServer(context: vscode.ExtensionContext): Promise<vo
590590
// Notify language server when workspace folders are added or removed
591591
context.subscriptions.push(
592592
vscode.workspace.onDidChangeWorkspaceFolders((e) => {
593-
client.sendNotification('stride/updateWorkspaceFolders', {
593+
client?.sendNotification('stride/updateWorkspaceFolders', {
594594
added: e.added.map((f) => f.uri.fsPath),
595595
removed: e.removed.map((f) => f.uri.fsPath),
596596
});

0 commit comments

Comments
 (0)