Skip to content

Commit 12a7297

Browse files
authored
Fix: Fixed crash when launching from CMD with "Files" (#13023)
1 parent 2bc403e commit 12a7297

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Files.App/MainWindow.xaml.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ public async Task InitializeApplication(object activatedEventArgs)
7373
switch (activatedEventArgs)
7474
{
7575
case ILaunchActivatedEventArgs launchArgs:
76-
if (launchArgs.Arguments is not null && launchArgs.Arguments.Contains($"files.exe", StringComparison.OrdinalIgnoreCase))
76+
if (launchArgs.Arguments is not null &&
77+
(CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files.exe", StringComparison.OrdinalIgnoreCase)
78+
|| CommandLineParser.SplitArguments(launchArgs.Arguments, true)[0].EndsWith($"files", StringComparison.OrdinalIgnoreCase)))
7779
{
7880
// WINUI3: When launching from commandline the argument is not ICommandLineActivatedEventArgs (#10370)
7981
var ppm = CommandLineParser.ParseUntrustedCommands(launchArgs.Arguments);

0 commit comments

Comments
 (0)