mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user