diff --git a/Editor/BaseConfigurationInspector.cs b/Editor/BaseConfigurationInspector.cs index 5b25dbe..878e6b4 100644 --- a/Editor/BaseConfigurationInspector.cs +++ b/Editor/BaseConfigurationInspector.cs @@ -74,8 +74,12 @@ protected static TConfiguration GetOrCreateInstance(Object target = null) { AssetDatabase.DeleteAsset(currentPath); var instances = AssetDatabase.FindAssets($"t:{typeof(TConfiguration).Name}"); - var path = AssetDatabase.GUIDToAssetPath(instances[0]); - instance = AssetDatabase.LoadAssetAtPath(path); + + if (instances is { Length: > 0 }) + { + var path = AssetDatabase.GUIDToAssetPath(instances[0]); + instance = AssetDatabase.LoadAssetAtPath(path); + } } update = true; diff --git a/package.json b/package.json index 8765f0d..dddc7a8 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "Utilities.Rest", "description": "This package contains useful RESTful utilities for the Unity Game Engine.", "keywords": [], - "version": "2.4.1", + "version": "2.4.2", "unity": "2021.3", "documentationUrl": "https://github.com/RageAgainstThePixel/com.utilities.rest#documentation", "changelogUrl": "https://github.com/RageAgainstThePixel/com.utilities.rest/releases",