### Godot version

41e5f5b0930343ef548a56d553ba20fafd672147

### System information

Windows 10, Vulkan, Intel® Core™ i7-8700K, Nvidia GTX 1080 (471.11)

### Issue description

The editor will crash if you select an AnimationTree node then select another node. This seems to be caused by the edit function assigning a null object via the edit interface, then calling another function which does not appear to be null.

### Steps to reproduce

Create an AnimationTree node then select another node.

### Minimal reproduction project

N/A
Vector<TransitionLine> multi_transitions = selected_multi_transition.multi_transitions;
	selected_multi_transition = TransitionLine();
	updating = true;
	EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
	undo_redo->create_action("Transition(s) Removed");
	_erase_selected(true);
	for (int i = 0; i < multi_transitions.size(); i++) {
		selected_transition_from = multi_transitions[i].from_node;
		selected_transition_to = multi_transitions[i].to_node;
		_erase_selected(true);
	}
	undo_redo->commit_action();
	updating = false;
	delete_window->hide();
}
void AnimationNodeStateMachineEditor::_delete_tree_draw() {
	TreeItem *item = delete_tree->get_next_selected(nullptr);
	while (item) {
		delete_window->get_cancel_button()->set_disabled(false);
		return;
	}
	delete_window->get_cancel_button()->set_disabled(true);
}
void AnimationNodeStateMachineEditor::_file_opened(const String &p_file) {