diff --git a/src/modules/launcher/Wox.Infrastructure/Helper.cs b/src/modules/launcher/Wox.Infrastructure/Helper.cs index 65daea49ea..e8360655d8 100644 --- a/src/modules/launcher/Wox.Infrastructure/Helper.cs +++ b/src/modules/launcher/Wox.Infrastructure/Helper.cs @@ -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); }