Fixed crash in decals handling caused by reference to undefined class

https://forum.drdteam.org/viewtopic.php?t=7589
This commit is contained in:
alexey.lysiuk 2017-04-01 10:36:35 +03:00
parent 59ae50aecb
commit 893607c96c

View file

@ -370,6 +370,12 @@ void FDecalLib::ReadAllDecals ()
for (i = 0; i < PClassActor::AllActorClasses.Size(); i++) for (i = 0; i < PClassActor::AllActorClasses.Size(); i++)
{ {
AActor *def = (AActor*)GetDefaultByType (PClassActor::AllActorClasses[i]); AActor *def = (AActor*)GetDefaultByType (PClassActor::AllActorClasses[i]);
if (nullptr == def)
{
// This is referenced but undefined class
// The corresponding warning should be already reported by DECORATE parser
continue;
}
FName v = ENamedName(intptr_t(def->DecalGenerator)); FName v = ENamedName(intptr_t(def->DecalGenerator));
if (v.IsValidName()) if (v.IsValidName())