1
0

Added a nullptr check to cEntity::IsA (#3659)

Fixes #3603
This commit is contained in:
Marvin Kopf 2017-04-01 23:15:08 +02:00 committed by Mattes D
parent 974c054bc9
commit dbdcb85346
3 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@
#define BLOCKENTITY_PROTODEF(classname) \
virtual bool IsA(const char * a_ClassName) const override \
{ \
return ((strcmp(a_ClassName, #classname) == 0) || super::IsA(a_ClassName)); \
return ((a_ClassName != nullptr) && ((strcmp(a_ClassName, #classname) == 0) || super::IsA(a_ClassName))); \
} \
virtual const char * GetClass(void) const override \
{ \

View File

@ -2013,7 +2013,7 @@ void cEntity::Detach(void)
bool cEntity::IsA(const char * a_ClassName) const
{
return (strcmp(a_ClassName, "cEntity") == 0);
return ((a_ClassName != nullptr) && (strcmp(a_ClassName, "cEntity") == 0));
}

View File

@ -12,7 +12,7 @@
#define CLASS_PROTODEF(classname) \
virtual bool IsA(const char * a_ClassName) const override\
{ \
return ((strcmp(a_ClassName, #classname) == 0) || super::IsA(a_ClassName)); \
return ((a_ClassName != nullptr) && ((strcmp(a_ClassName, #classname) == 0) || super::IsA(a_ClassName))); \
} \
virtual const char * GetClass(void) const override \
{ \