### 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
int idx = -1;
	for (int i = 0; i < node_rects.size(); i++) {
		if (node_rects[i].node_name == p_name) {
			idx = i;
			break;
		}
	}
	if (idx == -1) {
		return;
	}
	const NodeRect &nr = node_rects[idx];
	Vector2 from;
	from.x = nr.play.position.x;
	from.y = (nr.play.position.y + nr.play.size.y + nr.node.position.y + nr.node.size.y) * 0.5;
	Vector2 to;
	if (nr.edit.size.x) {
		to.x = nr.edit.position.x + nr.edit.size.x;
	} else {
		to.x = nr.name.position.x + nr.name.size.x;
	}
	to.y = from.y;
	float c = p_ratio;
	Color fg = get_theme_color(SNAME("font_color"), SNAME("Label"));
	Color bg = fg;
	bg.a *= 0.3;
	state_machine_play_pos->draw_line(from, to, bg, 2);
	to = from.lerp(to, c);
	state_machine_play_pos->draw_line(from, to, fg, 2);
}
void AnimationNodeStateMachineEditor::_state_machine_pos_draw_all() {