NULL out an object variable if it fails to register.

This commit is contained in:
Jeff Hutchinson 2021-09-07 21:03:57 -04:00
parent 55c0a748b4
commit 6d93e96dc3

View file

@ -1087,6 +1087,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa
// This error is usually caused by failing to call Parent::initPersistFields in the class' initPersistFields().
Con::warnf(ConsoleLogEntry::General, "%s: Register object failed for object %s of class %s.", getFileLine(ip - 2), currentNewObject->getName(), currentNewObject->getClassName());
delete currentNewObject;
currentNewObject = NULL;
ip = failJump;
break;
}