aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorendolf <[email protected]>2005-05-05 08:07:51 +0000
committerendolf <[email protected]>2005-05-05 08:07:51 +0000
commitd80501af2cede869da2614d1f39663e16324013d (patch)
treedb7bafc32449b2517d7ef7b45485c5834375d7c5 /plugins
parentff38a18f830bb2d12dca0794fceb37e0954240c5 (diff)
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
Diffstat (limited to 'plugins')
-rw-r--r--plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java8
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;