src/goEnvironmentStatus: avoid TypeError for notification closed without action
workbench.desktop.main.js:2247 TypeError: Cannot read property 'command' of undefined
at /Users/hakim/.vscode-insiders/extensions/golang.go-0.25.0/dist/goMain.js:60913
at processTicksAndRejections (internal/process/task_queues.js:93)
Change-Id: I50e345db15682028dc24a29584c604612cdb8364
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/321473
Trust: Hyang-Ah Hana Kim <hyangah@gmail.com>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Suzy Mueller <suzmue@golang.org>
diff --git a/src/goEnvironmentStatus.ts b/src/goEnvironmentStatus.ts
index 1190b31..2262aa6 100644
--- a/src/goEnvironmentStatus.ts
+++ b/src/goEnvironmentStatus.ts
@@ -621,8 +621,11 @@
neverAgain
)
.then((selection) => {
+ // TODO: should we removeGoStatus if user has closed the notification
+ // without any action? It's kind of a feature now - without selecting
+ // neverAgain, user can hide this statusbar item.
removeGoStatus();
- selection.command();
+ selection?.command();
});
});
}