Skip to content

Commit 41410fe

Browse files
committed
Fix an issue with undefined for files not in the model getting propagated
1 parent 06ec5ac commit 41410fe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/commandsAndMenu.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,11 @@ export function addFileBrowserContextMenu(
916916
addMenuItems(
917917
commandsList,
918918
this,
919-
paths.map(path => model.getFile(path))
919+
paths
920+
.map(path => model.getFile(path))
921+
// if file cannot be resolved (has no action available),
922+
// omit the undefined result
923+
.filter(file => typeof file !== 'undefined')
920924
);
921925
if (wasShown) {
922926
// show he menu again after downtime for refresh

0 commit comments

Comments
 (0)