Merge pull request #1708 from VictoriousRaptor/FixShortcutException

Catch exceptions during shortcut expansion
This commit is contained in:
VictoriousRaptor 2022-12-26 01:31:32 +08:00 committed by GitHub
commit 75624446e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -780,8 +780,16 @@ namespace Flow.Launcher.ViewModel
{
foreach (var shortcut in builtInShortcuts)
{
queryBuilder.Replace(shortcut.Key, shortcut.Expand());
queryBuilderTmp.Replace(shortcut.Key, shortcut.Expand());
try
{
var expansion = shortcut.Expand();
queryBuilder.Replace(shortcut.Key, expansion);
queryBuilderTmp.Replace(shortcut.Key, expansion);
}
catch (Exception e)
{
Log.Exception($"{nameof(MainViewModel)}.{nameof(ConstructQuery)}|Error when expanding shortcut {shortcut.Key}", e);
}
}
});