### 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
state_machine_draw->draw_style_box(sb == style_selected ? style_selected : end_overlay, nr.node);
		}
		if (playing && (blend_from == name || current == name || travel_path.has(name))) {
			state_machine_draw->draw_style_box(playing_overlay, nr.node);
		}
		offset.x += sb->get_offset().x;
		nr.play.position = offset + Vector2(0, (h - play->get_height()) / 2).floor();
		nr.play.size = play->get_size();
		Ref<Texture2D> play_tex = play;
		if (over_node == name && over_node_what == 0) {
			state_machine_draw->draw_texture(play_tex, nr.play.position, accent);
		} else {
			state_machine_draw->draw_texture(play_tex, nr.play.position);
		}
		offset.x += sep + play->get_width();
		nr.name.position = offset + Vector2(0, (h - font->get_height(font_size)) / 2).floor();
		nr.name.size = Vector2(strsize, font->get_height(font_size));
		state_machine_draw->draw_string(font, nr.name.position + Vector2(0, font->get_ascent(font_size)), name, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color);
		offset.x += strsize + sep;
		if (needs_editor) {
			nr.edit.position = offset + Vector2(0, (h - edit->get_height()) / 2).floor();
			nr.edit.size = edit->get_size();
			if (over_node == name && over_node_what == 1) {
				state_machine_draw->draw_texture(edit, nr.edit.position, accent);
			} else {
				state_machine_draw->draw_texture(edit, nr.edit.position);
			}
		}
	}