mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 07:34:45 +00:00
Merge pull request #1180 from Azaezel/alpha41/awryArrays
don't allow setting a key or value on -1 index
This commit is contained in:
commit
199ef84fcb
1 changed files with 2 additions and 2 deletions
|
|
@ -450,7 +450,7 @@ void ArrayObject::append(ArrayObject* obj)
|
||||||
|
|
||||||
void ArrayObject::setKey( const String &key, S32 index )
|
void ArrayObject::setKey( const String &key, S32 index )
|
||||||
{
|
{
|
||||||
if ( index >= mArray.size() )
|
if (index >= mArray.size() || index < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mArray[index].key = key;
|
mArray[index].key = key;
|
||||||
|
|
@ -460,7 +460,7 @@ void ArrayObject::setKey( const String &key, S32 index )
|
||||||
|
|
||||||
void ArrayObject::setValue( const String &value, S32 index )
|
void ArrayObject::setValue( const String &value, S32 index )
|
||||||
{
|
{
|
||||||
if ( index >= mArray.size() )
|
if (index >= mArray.size() || index < 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mArray[index].value = value;
|
mArray[index].value = value;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue