Skip to content

Commit 0d26ede

Browse files
committed
fix: console errors on project context menu open
1 parent 974dd71 commit 0d26ede

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/command/DefaultMenus.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ define(function (require, exports, module) {
4242
*/
4343
function _setContextMenuItemsVisible(enabled, items) {
4444
items.forEach(function (item) {
45-
CommandManager.get(item).setEnabled(enabled);
45+
const command = CommandManager.get(item);
46+
if(command) {
47+
// some commands may be only selectively present in browser or in some oses.
48+
// Eg. NAVIGATE_OPEN_IN_POWERSHELL is only present in Windows desktop apps
49+
command.setEnabled(enabled);
50+
}
4651
});
4752
}
4853

0 commit comments

Comments
 (0)