Browse Source

Attempt to resolve #4673

(cherry picked from commit 1939e83a653b3263eeac820a9e36d751a314068b)
Juan Linietsky 8 years ago
parent
commit
670d07ca0d
1 changed files with 6 additions and 4 deletions
  1. 6 4
      editor/plugins/canvas_item_editor_plugin.cpp

+ 6 - 4
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<CanvasItem>();
-#if 0
-		if ( b.pressed ) box_selection_start( click );
-#endif
+
+		if (n) {
+			c = n->cast_to<CanvasItem>();
+		} else {
+			c = NULL;
+		}
 
 		additive_selection = b.mod.shift;
 		if (!_select(c, click, additive_selection))