Merge pull request #114425 from KoBeWi/Null_the_Failer

Prevent crash when adding null Shortcut
This commit is contained in:
Rémi Verschelde
2026-01-05 11:45:13 +01:00

View File

@@ -1928,6 +1928,8 @@ void EditorSettings::_add_shortcut_default(const String &p_path, const Ref<Short
}
void EditorSettings::add_shortcut(const String &p_path, const Ref<Shortcut> &p_shortcut) {
ERR_FAIL_COND_MSG(p_shortcut.is_null(), "Cannot add a null shortcut for path: " + p_path);
Array use_events = p_shortcut->get_events();
if (shortcuts.has(p_path)) {
Ref<Shortcut> existing = shortcuts.get(p_path);