CesiumGS / cesium-unreal

Bringing the 3D geospatial ecosystem to Unreal Engine
https://cesium.com/platform/cesium-for-unreal/
Apache License 2.0
902 stars 287 forks source link

Add checks to CesiumSunSky to prevent possible crashes #1349

Closed azrogers closed 6 months ago

azrogers commented 6 months ago

There's been a few reports in our forums (here and here) that show some users are experiencing a crash on the line FVector location = transform.TransformPosition(getViewLocation(this->GetWorld())); in CesiumSunSky.cpp. While none of us are able to reproduce this bug, it seems likely that some sort of race condition is resulting in this->GetWorld() returning nullptr. Even if this isn't the source of these crashes, it's a good check to add anyways. I've also gone through CesiumSunSky to add checks to other locations where an unexpected nullptr might be possible and would cause a crash.

j9liu commented 6 months ago

Wondering if this old issue is also related + can be fixed by this: https://github.com/CesiumGS/cesium-unreal/issues/831

j9liu commented 6 months ago

Merging now that CI passed; thanks @azrogers !