From a4fde427b72f28b4bf07e064c8cfa508239fe85c Mon Sep 17 00:00:00 2001 From: Areloch Date: Sat, 23 Feb 2019 20:14:10 -0600 Subject: [PATCH] Update simObject.cpp better way to handle the validity check for const char* --- Engine/source/console/simObject.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index 28cbf1007..7374919f5 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -2834,7 +2834,8 @@ DefineEngineMethod( SimObject, getFieldValue, const char*, ( const char* fieldNa "@param index Optional parameter to specify the index of an array field separately.\n" "@return The value of the given field or \"\" if undefined." ) { - if (fieldName == "") + const U32 nameLen = dStrlen( fieldName ); + if (nameLen == 0) return ""; char fieldNameBuffer[ 1024 ];