fix: throw if provider is null
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user