Skip to content

Commit

Permalink
com.utilities.rest 2.4.2 (#58)
Browse files Browse the repository at this point in the history
- fixed null reference exception when creating configuration
  • Loading branch information
StephenHodgson authored Dec 28, 2023
1 parent 5fd4c5b commit 35f3247
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<TConfiguration>(path);

if (instances is { Length: > 0 })
{
var path = AssetDatabase.GUIDToAssetPath(instances[0]);
instance = AssetDatabase.LoadAssetAtPath<TConfiguration>(path);
}
}

update = true;
Expand Down
2 changes: 1 addition & 1 deletion Utilities.Rest/Packages/com.utilities.rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 35f3247

Please sign in to comment.