Node3DEditorViewport: Prevent crash while handling input
The selection might change before the user releases the mouse pointer, and this would crash the editor. This follows the same check that is done in ::_update_gizmos
This commit is contained in:
parent
8dcf5b4eaf
commit
eba4ceb0ea
1 changed files with 4 additions and 2 deletions
|
|
@ -2204,8 +2204,10 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
|
|||
if (_edit.original_mouse_pos != _edit.mouse_pos || _edit.gizmo->get_plugin()->can_commit_handle_on_click()) {
|
||||
_edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_handle_secondary, _edit.gizmo_initial_value, false);
|
||||
}
|
||||
|
||||
spatial_editor->get_single_selected_node()->update_gizmos();
|
||||
Node3D *selected_node = spatial_editor->get_single_selected_node();
|
||||
if (selected_node) {
|
||||
selected_node->update_gizmos();
|
||||
}
|
||||
_edit.gizmo = Ref<EditorNode3DGizmo>();
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue