Fix null pointer access in p_terrain.cpp

This commit is contained in:
Marrub 2018-11-23 17:46:34 -05:00 committed by drfrag666
parent 9022c98732
commit 3cf4a77c30

View file

@ -558,17 +558,17 @@ static void GenericParse (FScanner &sc, FGenericParse *parser, const char **keyw
else
{
info = PClass::FindClass (sc.String);
if (!info->IsDescendantOf (RUNTIME_CLASS(AActor)))
if (info == NULL)
{
Printf ("Unknown actor %s in %s %s\n",
sc.String, type, name.GetChars());
}
else if (!info->IsDescendantOf (RUNTIME_CLASS(AActor)))
{
Printf ("%s is not an Actor (in %s %s)\n",
sc.String, type, name.GetChars());
info = NULL;
}
else if (info == NULL)
{
Printf ("Unknown actor %s in %s %s\n",
sc.String, type, name.GetChars());
}
}
SET_FIELD (const PClass *, info);
break;