diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index 447d96ce4..6cf6fd029 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -2834,13 +2834,16 @@ 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." ) { + const U32 nameLen = dStrlen( fieldName ); + if (nameLen == 0) + return ""; + char fieldNameBuffer[ 1024 ]; char arrayIndexBuffer[ 64 ]; // Parse out index if the field is given in the form of 'name[index]'. const char* arrayIndex = NULL; - const U32 nameLen = dStrlen( fieldName ); if( fieldName[ nameLen - 1 ] == ']' ) { const char* leftBracket = dStrchr( fieldName, '[' );