diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index fabb67e310a..d504655597b 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -1459,10 +1459,12 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent &p_event) { while ((n && n != scene && n->get_owner() != scene) || (n && !n->is_type("CanvasItem"))) { n = n->get_parent(); }; - c = n->cast_to(); -#if 0 - if ( b.pressed ) box_selection_start( click ); -#endif + + if (n) { + c = n->cast_to(); + } else { + c = NULL; + } additive_selection = b.mod.shift; if (!_select(c, click, additive_selection))