After re-rendering the editor pane, the prior editor's disconnect handler runs, unsubscribing from state changes. However, by that time, the update handler has already run. So the editor attempts to render, which results in exceptions because the editor is expecting state that no longer exists.
Ideally, we can figure out why the update fires first and prevent that. A possible work around is to check the type of the gadget it references or set the path of the gadget in the data properties. These would be good improvements regardless.
After re-rendering the editor pane, the prior editor's disconnect handler runs, unsubscribing from state changes. However, by that time, the update handler has already run. So the editor attempts to render, which results in exceptions because the editor is expecting state that no longer exists.
Ideally, we can figure out why the update fires first and prevent that. A possible work around is to check the type of the gadget it references or set the path of the gadget in the data properties. These would be good improvements regardless.