diff options
author | Furkan Türkal <furkan.turkal@hotmail.com> | 2019-06-22 15:52:51 +0300 |
---|---|---|
committer | Furkan Türkal <furkan.turkal@hotmail.com> | 2019-07-01 14:28:29 +0300 |
commit | 7d8d337b2c47df88498067ff9091386691242144 (patch) | |
tree | 50dc0cb8fa683586cc947a2994fe48b45bba91b8 /scene/main | |
parent | 30383a1cdc00d398349515b81a85fa1d3da7ae37 (diff) |
fix some crashes
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/node.cpp | 6 | ||||
-rw-r--r-- | scene/main/viewport.cpp | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index ee23b24b3c..5008475749 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -71,6 +71,8 @@ void Node::_notification(int p_notification) { } break; case NOTIFICATION_ENTER_TREE: { + ERR_FAIL_COND(!get_viewport()); + ERR_FAIL_COND(!get_tree()); if (data.pause_mode == PAUSE_MODE_INHERIT) { @@ -94,6 +96,8 @@ void Node::_notification(int p_notification) { } break; case NOTIFICATION_EXIT_TREE: { + ERR_FAIL_COND(!get_viewport()); + ERR_FAIL_COND(!get_tree()); get_tree()->node_count--; orphan_node_count++; @@ -840,6 +844,8 @@ bool Node::is_processing_internal() const { void Node::set_process_priority(int p_priority) { data.process_priority = p_priority; + ERR_FAIL_COND(!data.tree); + if (is_processing()) data.tree->make_group_changed("idle_process"); diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 10e5ad78e2..5fd72d65e1 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1701,6 +1701,8 @@ bool Viewport::_gui_drop(Control *p_at_control, Point2 p_at_pos, bool p_just_che void Viewport::_gui_input_event(Ref<InputEvent> p_event) { + ERR_FAIL_COND(p_event.is_null()) + //? /* if (!is_visible()) { |