Linux: Fix an IndexOutOfBoundsException for unknown controller types

This commit is contained in:
elias 2006-12-23 07:51:58 +00:00
parent 43b4dab801
commit 9d211951c1

View file

@ -783,7 +783,9 @@ class LinuxNativeTypesMap {
* @return The jinput id
*/
public static Component.Identifier getButtonID(int nativeID) {
Component.Identifier retval = INSTANCE.buttonIDs[nativeID];
Component.Identifier retval = null;
if (nativeID >= 0 && nativeID < INSTANCE.buttonIDs.length)
retval = INSTANCE.buttonIDs[nativeID];
if(retval == null) {
retval = Component.Identifier.Key.UNKNOWN;
INSTANCE.buttonIDs[nativeID] = retval;