diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-04-02 13:04:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-02 13:04:14 +0200 |
commit | dee7fb5ab5b1870400b2ae2fe383d995d5e76476 (patch) | |
tree | 40131bf2d384028811ae8281021a3ecfaba2968b | |
parent | 3b256f1a9043bf6700f0d7281b9c671dcff7ac19 (diff) | |
parent | 1d3c9c448d805d0813a67efdd6677c312d72bb32 (diff) |
Merge pull request #8228 from Hinsbart/viewport_fix
Viewport: Fix undefined behaviour found by llvm sanitizer.
-rw-r--r-- | scene/main/viewport.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 23f8189167..3b8fd1ae3e 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1401,7 +1401,7 @@ void Viewport::_vp_input(const InputEvent &p_ev) { return; #ifdef TOOLS_ENABLED - if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) { + if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) { return; } #endif @@ -1422,7 +1422,7 @@ void Viewport::_vp_unhandled_input(const InputEvent &p_ev) { if (disable_input) return; #ifdef TOOLS_ENABLED - if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) { + if (get_tree()->is_editor_hint() && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->is_a_parent_of(this)) { return; } #endif |