diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/hlod.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/hlod.cpp index 4e8dc5d665e..3ba6192281c 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/hlod.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/hlod.cpp @@ -1262,6 +1262,10 @@ HLodClass & HLodClass::operator = (const HLodClass & that) for (model = 0; model < that.Lod[lod].Count(); model++) { + if (that.Lod[lod][model].Model == nullptr) { + continue; + } + ModelNodeClass newnode; newnode.Model = that.Lod[lod][model].Model->Clone(); newnode.BoneIndex = that.Lod[lod][model].BoneIndex; @@ -1277,6 +1281,10 @@ HLodClass & HLodClass::operator = (const HLodClass & that) AdditionalModels.Resize(that.AdditionalModels.Count()); for (model = 0; model < that.AdditionalModels.Count(); model++) { + if (that.AdditionalModels[model].Model == nullptr) { + continue; + } + ModelNodeClass newnode; newnode.Model = that.AdditionalModels[model].Model->Clone(); newnode.BoneIndex = that.AdditionalModels[model].BoneIndex; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hlod.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hlod.cpp index e65f7211d6e..10cbedc5cad 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hlod.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/hlod.cpp @@ -1262,6 +1262,10 @@ HLodClass & HLodClass::operator = (const HLodClass & that) for (model = 0; model < that.Lod[lod].Count(); model++) { + if (that.Lod[lod][model].Model == nullptr) { + continue; + } + ModelNodeClass newnode; newnode.Model = that.Lod[lod][model].Model->Clone(); newnode.BoneIndex = that.Lod[lod][model].BoneIndex; @@ -1277,6 +1281,10 @@ HLodClass & HLodClass::operator = (const HLodClass & that) AdditionalModels.Resize(that.AdditionalModels.Count()); for (model = 0; model < that.AdditionalModels.Count(); model++) { + if (that.AdditionalModels[model].Model == nullptr) { + continue; + } + ModelNodeClass newnode; newnode.Model = that.AdditionalModels[model].Model->Clone(); newnode.BoneIndex = that.AdditionalModels[model].BoneIndex;