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

@@ -467,7 +467,14 @@ public class XPlaneConnect implements AutoCloseable
{
if(i == 4)
{
bb.put(cur, (byte) values[i]);
if(i >= values.length)
{
bb.put(cur, (byte)-1);
}
else
{
bb.put(cur, (byte)values[i]);
}
cur += 1;
}
else if (i >= values.length)