Skip to content

Commit 397066c

Browse files
authored
Merge pull request #1261 from Areloch/setFieldValueSanityCheck
Adds a sanity check to SimObject's setFieldValue console method
2 parents e5aa6e4 + 51c1ab6 commit 397066c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Engine/source/console/simObject.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3072,6 +3072,13 @@ DefineEngineMethod( SimObject, setFieldValue, bool, ( const char* fieldName, con
30723072
{
30733073
char fieldNameBuffer[ 1024 ];
30743074
char arrayIndexBuffer[ 64 ];
3075+
3076+
if( !fieldName || !fieldName[0] )
3077+
{
3078+
AssertFatal(false, "SimObject::setFieldValue - Invalid field name.");
3079+
Con::errorf( "SimObject::setFieldValue - Invalid field name." );
3080+
return false;
3081+
}
30753082

30763083
// Parse out index if the field is given in the form of 'name[index]'.
30773084

0 commit comments

Comments
 (0)