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.
This commit is contained in:
David Wilson
2018-01-22 14:46:38 -08:00
parent c100ad0108
commit 4a151ac210

View File

@@ -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()