Fixed possible ArrayIndexOutOfBoundsException.

This commit is contained in:
danielnelz 2015-03-11 21:32:20 +01:00
parent 704821a8db
commit 52200edfd7
2 changed files with 2 additions and 2 deletions

View File

@ -135,7 +135,7 @@ public class KeychainIntentService extends IntentService implements Progressable
private static final IOType[] values = values();
public static IOType fromInt(int n) {
if(n >= values.length) {
if(n < 0 || n >= values.length) {
return UNKNOWN;
} else {
return values[n];

View File

@ -44,7 +44,7 @@ public class KeychainIntentServiceHandler extends Handler {
public static MessageStatus fromInt(int n)
{
if(n >= values.length) {
if(n < 0 || n >= values.length) {
return UNKNOWN;
} else {
return values[n];