CesiumGS / cesium-omniverse

Bringing the 3D geospatial ecosystem to Omniverse
https://cesium.com/platform/cesium-for-omniverse/
Apache License 2.0
51 stars 7 forks source link

Fix crash when dependent prims are removed in specific order #680

Closed lilleyse closed 5 months ago

lilleyse commented 5 months ago

The following scenario would cause a crash:

When prims are removed they update any assets that have a relationship to them. If the other assets had also been removed from the stage, during their update they may try to access properties on a USD prim that no longer exists.

I ended up making the fix in UsdNotificationHandler so that it checks whether prims exist before updating them.

I was able to trigger this by loading imagery-single-2.zip, hand deleting the raster overlay and rel from the .usda, and clicking the fetch changes button. This USD is a bit older and doesn't have an ion server in it, so the default ion server gets removed and the raster overlay gets removed.

lilleyse commented 5 months ago

@corybarr I ended up changing the approach because I realized this could be a broader issue. Now I check if the schema is valid before getting or setting an attribute.