Skip to content

Commit

Permalink
Desktop: make getMaxButtonIndex return at least 0, even if there is none
Browse files Browse the repository at this point in the history
  • Loading branch information
MrStahlfelge committed Jan 31, 2021
1 parent 602edd1 commit 867126d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ public int getMaxButtonIndex() {

maxButtonIndex = CODE_TO_BUTTON.size - 1;
try {
while (maxButtonIndex >= 0 && !controllerIndex.isButtonAvailable(CODE_TO_BUTTON.get(maxButtonIndex))) {
while (maxButtonIndex > 0 && !controllerIndex.isButtonAvailable(CODE_TO_BUTTON.get(maxButtonIndex))) {
maxButtonIndex--;
}
} catch (ControllerUnpluggedException e) {
Expand Down

0 comments on commit 867126d

Please sign in to comment.