提交 68bd82b3 编写于 作者: B Benjamin Pasero

fix #51188

上级 cdc10e31
...@@ -1063,14 +1063,16 @@ export class EditorViewStateMemento<T> { ...@@ -1063,14 +1063,16 @@ export class EditorViewStateMemento<T> {
public loadState(group: IEditorGroup, editor: EditorInput): T; public loadState(group: IEditorGroup, editor: EditorInput): T;
public loadState(group: IEditorGroup, resourceOrEditor: URI | EditorInput): T { public loadState(group: IEditorGroup, resourceOrEditor: URI | EditorInput): T {
const resource = this.doGetResource(resourceOrEditor); const resource = this.doGetResource(resourceOrEditor);
if (resource) { if (!resource || !group) {
return void 0; // we are not in a good state to load any viewstate for a resource
}
const cache = this.doLoad(); const cache = this.doLoad();
const viewStates = cache.get(resource.toString()); const viewStates = cache.get(resource.toString());
if (viewStates) { if (viewStates) {
return viewStates[group.id]; return viewStates[group.id];
} }
}
return void 0; return void 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册