### 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
if (d > transition_lines[i].width) {
					continue;
				}
				if (d < closest_d) {
					closest = i;
					closest_d = d;
				}
			}
			if (closest >= 0) {
				String from = String(transition_lines[closest].from_node);
				String to = String(transition_lines[closest].to_node);
				String tooltip = from + " -> " + to;
				for (int i = 0; i < transition_lines[closest].multi_transitions.size(); i++) {
					from = String(transition_lines[closest].multi_transitions[i].from_node);
					to = String(transition_lines[closest].multi_transitions[i].to_node);
					tooltip += "\n" + from + " -> " + to;
				}
				state_machine_draw->set_tooltip_text(tooltip);
			} else {
				state_machine_draw->set_tooltip_text("");
			}
		}
	}
	Ref<InputEventPanGesture> pan_gesture = p_event;
	if (pan_gesture.is_valid()) {
		h_scroll->set_value(h_scroll->get_value() + h_scroll->get_page() * pan_gesture->get_delta().x / 8);
		v_scroll->set_value(v_scroll->get_value() + v_scroll->get_page() * pan_gesture->get_delta().y / 8);
	}
}
Control::CursorShape AnimationNodeStateMachineEditor::get_cursor_shape(const Point2 &p_pos) const {