summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-09-26 08:38:12 +0200
committerGitHub <noreply@github.com>2021-09-26 08:38:12 +0200
commit79e33f8b711589a757792429c9bc4d29b223c2ce (patch)
treef6331b8cc3425b5e205d48eefb83970cd70a9e96 /core
parentc7f67daccdc389d5feb89775297cd521fb9af882 (diff)
parenteae7f1c1ae3505066b7697b51b2a877dd36e1542 (diff)
Merge pull request #53058 from LATRio/52191
check if 'shortcut' in InputEventShortcut is valid
Diffstat (limited to 'core')
-rw-r--r--core/input/input_event.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/input/input_event.cpp b/core/input/input_event.cpp
index 50b2099236..c2a9d30fff 100644
--- a/core/input/input_event.cpp
+++ b/core/input/input_event.cpp
@@ -1557,9 +1557,13 @@ bool InputEventShortcut::is_pressed() const {
}
String InputEventShortcut::as_text() const {
+ ERR_FAIL_COND_V(shortcut.is_null(), "None");
+
return vformat(RTR("Input Event with Shortcut=%s"), shortcut->get_as_text());
}
String InputEventShortcut::to_string() {
+ ERR_FAIL_COND_V(shortcut.is_null(), "None");
+
return vformat("InputEventShortcut: shortcut=%s", shortcut->get_as_text());
}