summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-04-02 13:04:14 +0200
committerGitHub <noreply@github.com>2017-04-02 13:04:14 +0200
commitdee7fb5ab5b1870400b2ae2fe383d995d5e76476 (patch)
tree40131bf2d384028811ae8281021a3ecfaba2968b
parent3b256f1a9043bf6700f0d7281b9c671dcff7ac19 (diff)
parent1d3c9c448d805d0813a67efdd6677c312d72bb32 (diff)
Merge pull request #8228 from Hinsbart/viewport_fix
Viewport: Fix undefined behaviour found by llvm sanitizer.
-rw-r--r--scene/main/viewport.cpp4
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