diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Commandlet/PrepareAssetsForCookingCommandlet.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Commandlet/PrepareAssetsForCookingCommandlet.cpp index f9b18dbb8..ce0dcdbab 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Commandlet/PrepareAssetsForCookingCommandlet.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Commandlet/PrepareAssetsForCookingCommandlet.cpp @@ -34,6 +34,9 @@ static bool ValidateStaticMesh(UStaticMesh *Mesh) for (int i = 0; i < Mesh->StaticMaterials.Num(); i++) { UMaterialInterface *Material = Mesh->GetMaterial(i); + if (!Material) { + Material = UMaterial::GetDefaultMaterial(MD_Surface); + } const FString MaterialName = Material->GetName(); if (MaterialName.Contains(TEXT("light"), ESearchCase::IgnoreCase) ||