diff options
-rw-r--r-- | plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java b/plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java index 6fcf06b..fc904f4 100644 --- a/plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java +++ b/plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java @@ -767,7 +767,13 @@ public class LinuxNativeTypesMap { * @return The jinput id */ public static Component.Identifier getAbsAxisID(int nativeID) { - Component.Identifier retval = INSTANCE.absAxesIDs[nativeID]; + Component.Identifier retval = null; + try { + retval = INSTANCE.absAxesIDs[nativeID]; + } catch (ArrayIndexOutOfBoundsException e) { + System.out.println("INSTANCE.absAxesIDs is only " + INSTANCE.absAxesIDs.length + " long, so " + nativeID + " not contained"); + //ignore, pretend it was null + } if(retval == null) { retval = Component.Identifier.Axis.SLIDER; INSTANCE.absAxesIDs[nativeID] = retval; |