From 97604464748ee018b691b394ac019694d439dc53 Mon Sep 17 00:00:00 2001 From: neru Date: Thu, 18 Jun 2026 17:53:13 -0300 Subject: [PATCH] fix: throw if provider is null --- src/dumper/dumper.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dumper/dumper.cs b/src/dumper/dumper.cs index 4eefae6..1251e34 100644 --- a/src/dumper/dumper.cs +++ b/src/dumper/dumper.cs @@ -263,6 +263,8 @@ class Dumper private void ExportIcon(string assetPath, string outPath) { + if (_provider == null) throw new InvalidOperationException("Attempted to export icon when dumper was not initialized/invalid"); + string cleanPath = assetPath.Contains('.') ? assetPath[..assetPath.LastIndexOf('.')] : assetPath; string fileName = Path.GetFileName(cleanPath) + ".png"; string relativeOutPath = outPath.TrimStart('/', '\\'); @@ -273,7 +275,6 @@ class Dumper if (File.Exists(fullPath)) return; - if (_provider == null) return; // special thanks to whichever dev kept fucking up the casing if (!_provider.TryLoadPackage(cleanPath, out IPackage? package)) {