[Ide] Fix NullReferenceException when undocking via double-click.