Skip to content

Commit 823d57a

Browse files
committed
Shortcuts reading: ignore shortcuts for invalid actions
1 parent b06a4d9 commit 823d57a

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)