|
@@ -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"
|
|
"@param index Optional parameter to specify the index of an array field separately.\n"
|
|
"@return The value of the given field or \"\" if undefined." )
|
|
"@return The value of the given field or \"\" if undefined." )
|
|
{
|
|
{
|
|
|
|
+ const U32 nameLen = dStrlen( fieldName );
|
|
|
|
+ if (nameLen == 0)
|
|
|
|
+ return "";
|
|
|
|
+
|
|
char fieldNameBuffer[ 1024 ];
|
|
char fieldNameBuffer[ 1024 ];
|
|
char arrayIndexBuffer[ 64 ];
|
|
char arrayIndexBuffer[ 64 ];
|
|
|
|
|
|
// Parse out index if the field is given in the form of 'name[index]'.
|
|
// Parse out index if the field is given in the form of 'name[index]'.
|
|
|
|
|
|
const char* arrayIndex = NULL;
|
|
const char* arrayIndex = NULL;
|
|
- const U32 nameLen = dStrlen( fieldName );
|
|
|
|
if( fieldName[ nameLen - 1 ] == ']' )
|
|
if( fieldName[ nameLen - 1 ] == ']' )
|
|
{
|
|
{
|
|
const char* leftBracket = dStrchr( fieldName, '[' );
|
|
const char* leftBracket = dStrchr( fieldName, '[' );
|