CesiumGS / cesium-unreal

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

`CesiumSunSky` will cause crash when no viewport activated in Editor #1459

Closed yuziqii closed 2 weeks ago

yuziqii commented 2 weeks ago

When I switch the Editor layout between viewport tab and CeiumPanel tab, CesiumSunSky causes a crash if no viewport activated in the Editor. BTW, I'm using CesiumForUnreal v2.6.0 and UE 5.4.

image

pViewport will be nullptr if no viewport activated.

image

j9liu commented 2 weeks ago

Hi @yuziqii,

Thanks for the catch! We should definitely check if pViewport is valid before dereferencing it. Would you be able to open a PR with the change?

yuziqii commented 2 weeks ago

Of course! Here is the PR. Let me know if you need any further adjustments.

j9liu commented 2 weeks ago

Closed by #1460 !