From dcfd1e1c2bc7d6dd1ad718c8ff63ba04ad80720c Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Mon, 12 Aug 2024 20:43:29 +0200 Subject: [PATCH] SkinModelImporter - Add null check in 'FixTexture' function --- PCK-Studio/Internal/SkinModelImporter.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PCK-Studio/Internal/SkinModelImporter.cs b/PCK-Studio/Internal/SkinModelImporter.cs index 75714c96..f95f2e28 100644 --- a/PCK-Studio/Internal/SkinModelImporter.cs +++ b/PCK-Studio/Internal/SkinModelImporter.cs @@ -473,6 +473,11 @@ namespace PckStudio.Internal private static Image FixTexture(Image texture, IEnumerable areasToFix) { + if (texture == null) + { + Trace.TraceError($"[{nameof(SkinModelImporter)}:{nameof(FixTexture)}] Failed to fix texture: texture is null."); + return null; + } Image result = new Bitmap(texture); using var g = Graphics.FromImage(result); g.ApplyConfig(new GraphicsConfig()