From eae7f1c1ae3505066b7697b51b2a877dd36e1542 Mon Sep 17 00:00:00 2001 From: LATRio Date: Sat, 25 Sep 2021 23:44:42 +0900 Subject: [PATCH] validate 'shortcut' in InputEventShortcut --- core/input/input_event.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/input/input_event.cpp b/core/input/input_event.cpp index 50b20992361..c2a9d30fff6 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()); }