summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-10-09 23:27:59 +0200
committerGitHub <noreply@github.com>2021-10-09 23:27:59 +0200
commit2a28df82d4979c3ca77c16ee9ae64c5a4f50a925 (patch)
treeead2d583b01e905888f8062b26f995c3270bfb8d /scene
parent53426bdc7195a3b4b9c1d0425d0ad5543ef3769a (diff)
parent80dc1cc412e83c354e233f67d4311580f7ffbe6b (diff)
Merge pull request #53614 from mashumafi/prevent-viewport-crash-2
Diffstat (limited to 'scene')
-rw-r--r--scene/main/viewport.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 3ab6e12e01..2982e33fcf 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1079,8 +1079,11 @@ Transform2D Viewport::_get_input_pre_xform() const {
}
Ref<InputEvent> Viewport::_make_input_local(const Ref<InputEvent> &ev) {
- Transform2D ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
+ if (ev.is_null()) {
+ return ev; // No transformation defined for null event
+ }
+ Transform2D ai = get_final_transform().affine_inverse() * _get_input_pre_xform();
return ev->xformed_by(ai);
}