Skip to content

Commit b14c193

Browse files
authored
Merge pull request #27259 from cbjeukendrup/shortcuts_ignore_invalid_actions
Shortcuts reading: ignore shortcuts for invalid actions
2 parents 5291070 + 823d57a commit b14c193

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/framework/shortcuts/internal/shortcutsregister.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,13 @@ Shortcut ShortcutsRegister::readShortcut(deprecated::XmlReader& reader) const
291291
}
292292
}
293293

294-
shortcut.context = uiactionsRegister()->action(shortcut.action).scCtx;
294+
auto action = uiactionsRegister()->action(shortcut.action);
295+
if (!action.isValid()) {
296+
LOGW() << "ignoring shortcut for invalid action: " << shortcut.action;
297+
return Shortcut();
298+
}
299+
300+
shortcut.context = action.scCtx;
295301

296302
return shortcut;
297303
}

0 commit comments

Comments
 (0)