From 193ce11c994b7c0ab9abcbace992f2d5a968acef Mon Sep 17 00:00:00 2001 From: Gustave Monce Date: Sun, 22 Sep 2024 20:58:58 +0200 Subject: [PATCH] fix: bad condition check on storeheader --- Img2Ffu.Library/Writer/Data/StoreHeader.cs | 2 +- Img2Ffu/Program.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Img2Ffu.Library/Writer/Data/StoreHeader.cs b/Img2Ffu.Library/Writer/Data/StoreHeader.cs index b06778b..700865a 100644 --- a/Img2Ffu.Library/Writer/Data/StoreHeader.cs +++ b/Img2Ffu.Library/Writer/Data/StoreHeader.cs @@ -107,7 +107,7 @@ public byte[] GetResultingBuffer(FlashUpdateVersion storeHeaderVersion, FlashUpd CompressionAlgorithm = (uint)storeHeaderCompressionAlgorithm; break; case FlashUpdateVersion.V2: - if (!string.IsNullOrEmpty(DevicePath)) + if (string.IsNullOrEmpty(DevicePath)) { throw new ArgumentException(nameof(DevicePath)); } diff --git a/Img2Ffu/Program.cs b/Img2Ffu/Program.cs index 63d3e82..1a7f1d5 100644 --- a/Img2Ffu/Program.cs +++ b/Img2Ffu/Program.cs @@ -246,8 +246,7 @@ private static void Main(string[] args) catch (Exception ex) { Logging.Log("Something happened.", LoggingLevel.Error); - Logging.Log(ex.Message, LoggingLevel.Error); - Logging.Log(ex.StackTrace!, LoggingLevel.Error); + Logging.Log(ex.ToString(), LoggingLevel.Error); Environment.Exit(1); } });