Browse Source

Attempt to resolve #4673

Juan Linietsky 8 years ago
parent
commit
1939e83a65
1 changed files with 6 additions and 1 deletions
  1. 6 1
      editor/plugins/canvas_item_editor_plugin.cpp

+ 6 - 1
editor/plugins/canvas_item_editor_plugin.cpp

@@ -1390,7 +1390,12 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) {
 		while ((n && n != scene && n->get_owner() != scene) || (n && !n->is_class("CanvasItem"))) {
 		while ((n && n != scene && n->get_owner() != scene) || (n && !n->is_class("CanvasItem"))) {
 			n = n->get_parent();
 			n = n->get_parent();
 		};
 		};
-		c = n->cast_to<CanvasItem>();
+
+		if (n) {
+			c = n->cast_to<CanvasItem>();
+		} else {
+			c = NULL;
+		}
 
 
 		// Select the item
 		// Select the item
 		additive_selection = b->get_shift();
 		additive_selection = b->get_shift();