Skip to content

Commit b709601

Browse files
altunsercanMathijs-Bakker
authored andcommitted
Intentionally throw error on addressable fail
1 parent 9bc6522 commit b709601

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

UnityProject/Assets/Plugins/Zenject/OptionalExtras/Async/Runtime/Providers/AddressableProviderSimple.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ public void GetAllInstancesWithInjectSplit(InjectContext context, List<TypeValue
3434
{
3535
AsyncOperationHandle<TConcrete> loadHandle = Addressables.LoadAssetAsync<TConcrete>(assetReference);
3636
await loadHandle.Task;
37+
38+
if (loadHandle.Status == AsyncOperationStatus.Failed)
39+
{
40+
throw new Exception("Async operation failed", loadHandle.OperationException);
41+
}
42+
3743
return loadHandle;
3844
};
3945

0 commit comments

Comments
 (0)