Skip to content

Commit

Permalink
Fix edge case in LogicHelper's list get or default
Browse files Browse the repository at this point in the history
  • Loading branch information
KnightMiner committed Oct 29, 2022
1 parent 6cb98c6 commit 956be93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/slimeknights/mantle/util/LogicHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static int defaultIf(int check, int undesired, int fallback) {
* @return List value or default
*/
public static <E> E getOrDefault(List<E> list, int index, E defaultValue) {
if (index < 0 || index > list.size()) {
if (index < 0 || index >= list.size()) {
return defaultValue;
}
return list.get(index);
Expand Down

0 comments on commit 956be93

Please sign in to comment.