From e76e4acb0f07bed34cdce15af990a0f421dd4ad6 Mon Sep 17 00:00:00 2001 From: marioalexis Date: Sun, 22 May 2022 02:38:43 -0300 Subject: [PATCH] Base: Prevent crash when trying to create badType instance --- src/Base/Type.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Base/Type.cpp b/src/Base/Type.cpp index dd97820655..ef410857f9 100644 --- a/src/Base/Type.cpp +++ b/src/Base/Type.cpp @@ -84,7 +84,8 @@ Type::~Type() void *Type::createInstance() { - return (typedata[index]->instMethod)(); + instantiationMethod method = typedata[index]->instMethod; + return method ? (*method)() : nullptr; }