summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/BlockEntities/BlockEntity.h2
-rw-r--r--src/Entities/Entity.cpp2
-rw-r--r--src/Entities/Entity.h2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/BlockEntities/BlockEntity.h b/src/BlockEntities/BlockEntity.h
index 65079508d..17c0677ec 100644
--- a/src/BlockEntities/BlockEntity.h
+++ b/src/BlockEntities/BlockEntity.h
@@ -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 \
{ \
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index a37100c8b..7b1849b9f 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -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));
}
diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h
index c9d445de7..b7778e797 100644
--- a/src/Entities/Entity.h
+++ b/src/Entities/Entity.h
@@ -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 \
{ \