Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,21 @@ private void ConvertFromAssetBundle(in Entity entity, ref GetGltfContainerAssetI

AssetBundleData assetBundleData = assetBundleResult.Asset!;

if (Utils.TryCreateGltfObject(assetBundleData, assetIntention.Hash, out GltfContainerAsset result))
World.Add(entity, new StreamableLoadingResult<GltfContainerAsset>(result));
else
World.Add(entity, new StreamableLoadingResult<GltfContainerAsset>(GetReportData(), new ArgumentException($"Failed to load {assetIntention.Hash} from AB")));
// Instantiation can throw if the AB's underlying Unity asset was destroyed/unloaded
// (ref-counted bundle evicted) leaving a "fake-null" object that TryGetAsset still returns.
// Convert to a failed result instead of letting it escape Update as an EcsSystemException
// (UNITY-EXPLORER-P76 — top crash, 4911 evts/68 users). Mirrors the else-branch failure path.
try
{
if (Utils.TryCreateGltfObject(assetBundleData, assetIntention.Hash, out GltfContainerAsset result))
World.Add(entity, new StreamableLoadingResult<GltfContainerAsset>(result));
else
World.Add(entity, new StreamableLoadingResult<GltfContainerAsset>(GetReportData(), new ArgumentException($"Failed to load {assetIntention.Hash} from AB")));
}
catch (Exception e)
{
World.Add(entity, new StreamableLoadingResult<GltfContainerAsset>(GetReportData(), new ArgumentException($"Failed to instantiate {assetIntention.Hash} from AB", e)));
}

}

Expand Down
Loading