From d80501af2cede869da2614d1f39663e16324013d Mon Sep 17 00:00:00 2001 From: endolf Date: Thu, 5 May 2005 08:07:51 +0000 Subject: Handle missing absolute axis ID's git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@90 e343933a-64c8-49c5-92b1-88f2ce3e89e8 --- .../linux/src/java/net/java/games/input/LinuxNativeTypesMap.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3