From 993abf01fc75230313e2c91f032ce03f80c43c95 Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 7 Jul 2017 17:41:16 -0700 Subject: [PATCH] Fix garc unpack exception after unpack label object was not provided Closes #161 --- pk3DS/GarcUtil.cs | 5 ++++- pk3DS/Main.cs | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pk3DS/GarcUtil.cs b/pk3DS/GarcUtil.cs index 80f1a5a..6600aad 100644 --- a/pk3DS/GarcUtil.cs +++ b/pk3DS/GarcUtil.cs @@ -98,9 +98,12 @@ public static bool garcUnpack(string garcPath, string outPath, bool skipDecompre if (!supress) WinFormsUtil.Alert("Unpack Successful!", fileCount + " files unpacked from the GARC!"); } + if (label == null) + return true; if (label.InvokeRequired) label.Invoke((MethodInvoker)delegate { label.Visible = false; }); - else { label.Visible = false; } + else + label.Visible = false; return true; } catch (FileNotFoundException) diff --git a/pk3DS/Main.cs b/pk3DS/Main.cs index 0e2c363..42da008 100644 --- a/pk3DS/Main.cs +++ b/pk3DS/Main.cs @@ -1172,7 +1172,7 @@ private bool getGARC(string infile, string outfolder, bool PB, bool bypassExt = } try { - bool success = GarcUtil.garcUnpack(infile, outfolder, bypassExt, PB ? pBar1 : null, null, true, bypassExt); + bool success = GarcUtil.garcUnpack(infile, outfolder, bypassExt, PB ? pBar1 : null, L_Status, true, bypassExt); updateStatus(string.Format(success ? "Success!" : "Failed!"), false); threads--; return success; @@ -1186,7 +1186,7 @@ private bool setGARC(string outfile, string infolder, int padBytes, bool PB) try { - bool success = GarcUtil.garcPackMS(infolder, outfile, Config.GARCVersion, padBytes, PB ? pBar1 : null, null, true); + bool success = GarcUtil.garcPackMS(infolder, outfile, Config.GARCVersion, padBytes, PB ? pBar1 : null, L_Status, true); threads--; updateStatus(string.Format(success ? "Success!" : "Failed!"), false); return success;