Skip to content

Commit cb44966

Browse files
Catch exceptions during shortcut expansion
1 parent bade0fc commit cb44966

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,16 @@ private Query ConstructQuery(string queryText, IEnumerable<CustomShortcutModel>
769769
{
770770
foreach (var shortcut in builtInShortcuts)
771771
{
772-
queryBuilder.Replace(shortcut.Key, shortcut.Expand());
773-
queryBuilderTmp.Replace(shortcut.Key, shortcut.Expand());
772+
try
773+
{
774+
var expansion = shortcut.Expand();
775+
queryBuilder.Replace(shortcut.Key, expansion);
776+
queryBuilderTmp.Replace(shortcut.Key, expansion);
777+
}
778+
catch (Exception e)
779+
{
780+
Log.Exception($"{nameof(MainViewModel)}.{nameof(ConstructQuery)}|Error when expanding shortcut {shortcut.Key}", e);
781+
}
774782
}
775783
});
776784

0 commit comments

Comments
 (0)