From e454c22053a4deb3f8dd28e7af5d079ce1b5c07b Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sat, 17 May 2025 02:46:48 +0900 Subject: [PATCH] Adopt the code review --- WelsonJS.Toolkit/WelsonJS.Launcher/ZipExtractor.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/WelsonJS.Toolkit/WelsonJS.Launcher/ZipExtractor.cs b/WelsonJS.Toolkit/WelsonJS.Launcher/ZipExtractor.cs index bcf60d7..2b5a48c 100644 --- a/WelsonJS.Toolkit/WelsonJS.Launcher/ZipExtractor.cs +++ b/WelsonJS.Toolkit/WelsonJS.Launcher/ZipExtractor.cs @@ -92,9 +92,6 @@ namespace WelsonJS.Launcher private bool IsValidFile(string filePath) { - if (!File.Exists(filePath)) - throw new FileNotFoundException("File does not exist.", filePath); - byte[] signature = new byte[4]; using (var fs = File.OpenRead(filePath)) @@ -165,17 +162,15 @@ namespace WelsonJS.Launcher private bool ExtractUsingShell(string filePath, string workingDirectory) { var shellAppType = Type.GetTypeFromProgID("Shell.Application"); - if (shellAppType == null) return false; dynamic shell = Activator.CreateInstance(shellAppType); if (shell == null) return false; + dynamic zip = shell.NameSpace(filePath); dynamic dest = shell.NameSpace(workingDirectory); - dynamic dest = shell.NameSpace(workingDirectory); - if (zip == null || dest == null) return false;