aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorelias <[email protected]>2006-12-23 07:51:58 +0000
committerelias <[email protected]>2006-12-23 07:51:58 +0000
commitbd9bcf646a4938354edd623a17e0f4443365f817 (patch)
tree22737ea8244b32f3917354ade5ee3cec1ef2eef1 /plugins
parent224a61f20e5ca46cb2f777036673690fec376cda (diff)
Linux: Fix an IndexOutOfBoundsException for unknown controller types
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@174 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'plugins')
-rw-r--r--plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java4
1 files changed, 3 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 a739074..77d7da7 100644
--- a/plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java
+++ b/plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java
@@ -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;