mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 09:46:54 +02:00
[PTRun][WebSearch]Fix empty browser pattern crash (#18480)
This commit is contained in:
@@ -150,7 +150,11 @@ namespace Wox.Infrastructure
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user