From 14dcf3d2cef2af3207a1ea1ec21401a3bd586bd0 Mon Sep 17 00:00:00 2001 From: Ovidiu Iliescu Date: Fri, 23 May 2014 11:14:20 +0300 Subject: [PATCH] Fixed OOB error in the MenuBar --- .../source/src/de/enough/polish/ui/MenuBar.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enough-polish-j2me/source/src/de/enough/polish/ui/MenuBar.java b/enough-polish-j2me/source/src/de/enough/polish/ui/MenuBar.java index 8cedff8..4a828e2 100644 --- a/enough-polish-j2me/source/src/de/enough/polish/ui/MenuBar.java +++ b/enough-polish-j2me/source/src/de/enough/polish/ui/MenuBar.java @@ -1346,7 +1346,7 @@ protected boolean handleKeyPressed(int keyCode, int gameAction) { //#endif if (keyCode >= Canvas.KEY_NUM1 && keyCode <= Canvas.KEY_NUM9) { int index = keyCode - Canvas.KEY_NUM1; - if (index <= this.commandsContainer.size()) { + if (index < this.commandsContainer.size()) { CommandItem item = (CommandItem) this.commandsContainer.get(index); if (item.getAppearanceMode() != Item.PLAIN) { if (!item.isFocused) { @@ -1574,7 +1574,7 @@ protected boolean handleKeyReleased(int keyCode, int gameAction) { } else { if (keyCode >= Canvas.KEY_NUM1 && keyCode <= Canvas.KEY_NUM9) { int index = keyCode - Canvas.KEY_NUM1; - if (index <= this.commandsContainer.size()) { + if (index < this.commandsContainer.size()) { CommandItem item = (CommandItem) this.commandsContainer.get(index); if (item.getAppearanceMode() != Item.PLAIN) { if (!item.isFocused) {