Skip to content

Commit 51f8bb2

Browse files
authored
Update AssetsContainer.cs
1 parent ffa0bcc commit 51f8bb2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

DataSerializer/AssetsContainer.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public bool TryResolveReference(string id, out object value)
3636
return false;
3737

3838
bool contains = TryGetValue(id, out var entry);
39-
value = entry?.Asset;
39+
value = entry.Asset;
4040

4141
return contains;
4242
}
@@ -45,6 +45,11 @@ public bool TryResolveReference(string id, out object value)
4545
// TODO: Make everything with loops and lists instead of LINQ
4646
public void LoadAssets()
4747
{
48+
if (_paths == null || _paths.Length == 0)
49+
return;
50+
51+
_paths = _paths.Where(x => !string.IsNullOrEmpty(x) && AssetDatabase.IsValidFolder(x)).ToArray();
52+
4853
var assets = new List<Object>();
4954

5055
assets = AssetDatabase

0 commit comments

Comments
 (0)