fix possible array out of bounds

This commit is contained in:
creeper123123321 2019-03-30 15:08:31 -03:00
parent 1f3ed39eb6
commit 6f20b874c5
No known key found for this signature in database
GPG Key ID: 0AC57D54786721D1

View File

@ -39,6 +39,6 @@ public class SoundMapping {
} }
public static int getOldSound(int newSound) { public static int getOldSound(int newSound) {
return newSound >= sounds.length ? -1 : sounds[newSound]; return newSound < 0 || newSound >= sounds.length ? -1 : sounds[newSound];
} }
} }