From 3d9397a8702183abc8ac74b2b2784b7f584986a1 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sun, 15 Dec 2024 09:01:45 +0800 Subject: [PATCH] Fix: Fixed an issue for opening storage sense causes NullReferenceException --- src/Files.App/Utils/Shell/LaunchHelper.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Files.App/Utils/Shell/LaunchHelper.cs b/src/Files.App/Utils/Shell/LaunchHelper.cs index 715349b2f6dc..60ca3232b10d 100644 --- a/src/Files.App/Utils/Shell/LaunchHelper.cs +++ b/src/Files.App/Utils/Shell/LaunchHelper.cs @@ -16,11 +16,12 @@ namespace Files.App.Utils.Shell /// public static class LaunchHelper { - public static void LaunchSettings(string page) + public unsafe static void LaunchSettings(string page) { - var appActiveManager = new IApplicationActivationManager(); + using ComPtr pApplicationActivationManager = default; + pApplicationActivationManager.CoCreateInstance(); - appActiveManager.ActivateApplication( + pApplicationActivationManager.Get()->ActivateApplication( "windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel", page, ACTIVATEOPTIONS.AO_NONE,