From 4a151ac210a9aecef4be212ef3b1dd667440fd13 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Mon, 22 Jan 2018 14:46:38 -0800 Subject: [PATCH] Fix #14716: Error when deserializing TreeView for project This change fixes an issue that appears when the user removes the last project from the workspace and then re-adds it. At this time an error is thrown from within ItemRegistry because the PaneContainer that holds the TreeView in the left-most dock does not clear out its existing ItemRegistry before deserializing the old TreeView state. The fix is to create a new ItemRegistry when a PaneContainer is deserialized so that the previous Pane's items are not retained. --- src/pane-container.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pane-container.js b/src/pane-container.js index 25e57acc8..b14d6ea57 100644 --- a/src/pane-container.js +++ b/src/pane-container.js @@ -51,6 +51,7 @@ class PaneContainer { deserialize (state, deserializerManager) { if (state.version !== SERIALIZATION_VERSION) return + this.itemRegistry = new ItemRegistry() this.setRoot(deserializerManager.deserialize(state.root)) this.activePane = find(this.getRoot().getPanes(), pane => pane.id === state.activePaneId) || this.getPanes()[0] if (this.config.get('core.destroyEmptyPanes')) this.destroyEmptyPanes()