diff --git a/Unreal/Plugins/AirSim/Source/SimMode/SimModeBase.cpp b/Unreal/Plugins/AirSim/Source/SimMode/SimModeBase.cpp index ae53d7272d..454322cc40 100644 --- a/Unreal/Plugins/AirSim/Source/SimMode/SimModeBase.cpp +++ b/Unreal/Plugins/AirSim/Source/SimMode/SimModeBase.cpp @@ -160,7 +160,8 @@ void ASimModeBase::initializeTimeOfDay() UObjectProperty* sun_prop = Cast(p); UObject* sun_obj = sun_prop->GetObjectPropertyValue_InContainer(sky_sphere_); sun_ = Cast(sun_obj); - default_sun_rotation_ = sun_->GetActorRotation(); + if (sun_) + default_sun_rotation_ = sun_->GetActorRotation(); } }