From 2e2fe8744549e119da6f6c124d698c2b5d8f1f39 Mon Sep 17 00:00:00 2001 From: Marrub Date: Fri, 23 Nov 2018 17:46:34 -0500 Subject: [PATCH] Fix null pointer access in p_terrain.cpp --- src/p_terrain.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/p_terrain.cpp b/src/p_terrain.cpp index 73756ec57..d1f6d7e3a 100644 --- a/src/p_terrain.cpp +++ b/src/p_terrain.cpp @@ -556,17 +556,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;