mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
Sanity check so calling getFieldValue on a blank fieldName doesn't cause a crash.
This commit is contained in:
parent
e0627973fb
commit
6f418cc183
1 changed files with 3 additions and 0 deletions
|
|
@ -2834,6 +2834,9 @@ 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." )
|
||||||
{
|
{
|
||||||
|
if (fieldName == "")
|
||||||
|
return "";
|
||||||
|
|
||||||
char fieldNameBuffer[ 1024 ];
|
char fieldNameBuffer[ 1024 ];
|
||||||
char arrayIndexBuffer[ 64 ];
|
char arrayIndexBuffer[ 64 ];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue