Skip to content

Commit

Permalink
Fixed exception being caused by giving PaginationHelper an empty list
Browse files Browse the repository at this point in the history
  • Loading branch information
landonjw committed Apr 12, 2021
1 parent 06f2f11 commit 31bfff7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
modGroup=ca.landonjw
modVersion=2.0.2
modVersion=2.0.3
modBaseName=GooeyLibs
forgeVersion=1.12.2-14.23.5.2838
mcpVersion=stable_39
2 changes: 1 addition & 1 deletion src/main/java/ca/landonjw/gooeylibs2/GooeyLibs.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ public class GooeyLibs {
/**
* The version of the library.
*/
public static final String VERSION = "2.0.2";
public static final String VERSION = "2.0.3";

}
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ public static LinkedPage createPagesFromPlaceholders(@Nonnull Template template,

List<LinkedPage> pages = new ArrayList<>();
int currentIndex = 0; // Stores the index of the current button being replaced

if (toReplace.isEmpty()) {
return builder.template(template.clone()).build();
}

while (currentIndex < toReplace.size()) {
// Clones the template, and replaces all placeholders with buttons from toReplace.
Template replacement = template.clone();
Expand Down

0 comments on commit 31bfff7

Please sign in to comment.