提交 b76fecb4 编写于 作者: M Matt Bierner

Strict null check listCommands

上级 aa912c88
......@@ -93,6 +93,7 @@
"./vs/workbench/api/shared/tasks.ts",
"./vs/workbench/browser/actions.ts",
"./vs/workbench/browser/actions/layoutActions.ts",
"./vs/workbench/browser/actions/listCommands.ts",
"./vs/workbench/browser/actions/navigationActions.ts",
"./vs/workbench/browser/actions/workspaceActions.ts",
"./vs/workbench/browser/actions/workspaceCommands.ts",
......
......@@ -88,10 +88,12 @@ function expandMultiSelection(focused: List<any> | PagedList<any> | ITree | Obje
const focus = list.getFocus() ? list.getFocus()[0] : undefined;
const selection = list.getSelection();
if (selection && selection.indexOf(focus) >= 0) {
if (selection && typeof focus === 'number' && selection.indexOf(focus) >= 0) {
list.setSelection(selection.filter(s => s !== previousFocus));
} else {
list.setSelection(selection.concat(focus));
if (typeof focus === 'number') {
list.setSelection(selection.concat(focus));
}
}
}
......@@ -636,7 +638,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
const selectedNode = tree.getNode(start);
const parentNode = selectedNode.parent;
if (!parentNode.parent) { // root
if (!parentNode || !parentNode.parent) { // root
scope = undefined;
} else {
scope = parentNode.element;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册