diff --git a/Source/Engine/Level/Actors/StaticModel.cpp b/Source/Engine/Level/Actors/StaticModel.cpp index aa6772904..07ff609bd 100644 --- a/Source/Engine/Level/Actors/StaticModel.cpp +++ b/Source/Engine/Level/Actors/StaticModel.cpp @@ -553,13 +553,11 @@ const Span StaticModel::GetMaterialSlots() const MaterialBase* StaticModel::GetMaterial(int32 entryIndex) { - if (Model) - Model->WaitForLoaded(); - else + if (!Model || Model->WaitForLoaded()) return nullptr; CHECK_RETURN(entryIndex >= 0 && entryIndex < Entries.Count(), nullptr); MaterialBase* material = Entries[entryIndex].Material.Get(); - if (!material) + if (!material && entryIndex < Model->MaterialSlots.Count()) { material = Model->MaterialSlots[entryIndex].Material.Get(); if (!material)