summaryrefslogtreecommitdiff
path: root/core/input
diff options
context:
space:
mode:
authorLATRio <AlSenya@yandex.ru>2021-09-25 23:44:42 +0900
committerLATRio <AlSenya@yandex.ru>2021-09-26 11:06:16 +0900
commiteae7f1c1ae3505066b7697b51b2a877dd36e1542 (patch)
tree50bac5e1bf48fc68be06f435efe1cf5e534b50c9 /core/input
parent9013771b53cdbc6451f2645f3618ad59d90a2fb1 (diff)
validate 'shortcut' in InputEventShortcut
Diffstat (limited to 'core/input')
-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());
}