From 92e07da92902b5be34d03430c7d5a07eb9aa5e10 Mon Sep 17 00:00:00 2001 From: hishitetsu <66369541+hishitetsu@users.noreply.github.com> Date: Sun, 7 May 2023 14:35:35 +0900 Subject: [PATCH] Fix: Fixed crash with Win32Exception (#12299) --- src/Files.App/Helpers/FileOperationsHelpers.cs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/Files.App/Helpers/FileOperationsHelpers.cs b/src/Files.App/Helpers/FileOperationsHelpers.cs index 4599da865a62..2cd4ad0cef1e 100644 --- a/src/Files.App/Helpers/FileOperationsHelpers.cs +++ b/src/Files.App/Helpers/FileOperationsHelpers.cs @@ -2,22 +2,12 @@ using Files.App.Filesystem.Security; using Files.App.Shell; using Files.Backend.Helpers; -using Files.Shared; -using Files.Shared.Enums; -using Files.Shared.Extensions; using Microsoft.Extensions.Logging; using Microsoft.Win32; -using System; using System.Collections.Concurrent; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; using System.IO; -using System.Linq; using System.Runtime.InteropServices; using System.Security.Principal; -using System.Threading; -using System.Threading.Tasks; using Tulpep.ActiveDirectoryObjectPicker; using Vanara.PInvoke; using Vanara.Windows.Shell; @@ -522,7 +512,7 @@ public static void TryCancelOperation(string operationId) { Name = x.ProcessName, Pid = x.Id, - FileName = x.MainModule?.FileName, + FileName = SafetyExtensions.IgnoreExceptions(() => x.MainModule?.FileName), AppName = SafetyExtensions.IgnoreExceptions(() => x.MainModule?.FileVersionInfo?.FileDescription) }).ToList(); processes.ForEach(x => x.Dispose());