Fixed potential index out of range error in Java client.

This commit is contained in:
Jason Watkins
2015-07-06 08:37:27 -07:00
parent ad2f455079
commit ea2b1a07d2
2 changed files with 8 additions and 1 deletions

View File

@@ -466,8 +466,15 @@ public class XPlaneConnect implements AutoCloseable
for(i = 0; i < 6; ++i) for(i = 0; i < 6; ++i)
{ {
if(i == 4) if(i == 4)
{
if(i >= values.length)
{
bb.put(cur, (byte)-1);
}
else
{ {
bb.put(cur, (byte)values[i]); bb.put(cur, (byte)values[i]);
}
cur += 1; cur += 1;
} }
else if (i >= values.length) else if (i >= values.length)