Skip to content

Commit

Permalink
[PTRun][WebSearch]Fix empty browser pattern crash (#18480)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimecbernardo committed May 25, 2022
1 parent f9e9679 commit a9181a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modules/launcher/Wox.Infrastructure/Helper.cs
Expand Up @@ -150,7 +150,11 @@ public static Process OpenInConsole(string path)

public static bool OpenCommandInShell(string path, string pattern, string arguments, string workingDir = null, ShellRunAsType runAs = ShellRunAsType.None, bool runWithHiddenWindow = false)
{
if (pattern.Contains("%1", StringComparison.Ordinal))
if (string.IsNullOrEmpty(pattern))
{
Log.Warn("Trying to run OpenCommandInShell with an empty pattern. The default browser definition might have issues.", typeof(Helper));
}
else if (pattern.Contains("%1", StringComparison.Ordinal))
{
arguments = pattern.Replace("%1", arguments);
}
Expand Down

0 comments on commit a9181a0

Please sign in to comment.