Skip to content

Commit 59256bd

Browse files
committed
Add onPageChange null check to #setCurrentPage. Closes #13
1 parent 8c5d17b commit 59256bd

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.idea/discord.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/com/samjakob/spigui/SGMenu.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ public int getCurrentPage() {
395395
*/
396396
public void setCurrentPage (int page) {
397397
this.currentPage = page;
398-
this.onPageChange.accept(this);
398+
if (this.onPageChange != null) this.onPageChange.accept(this);
399399
}
400400

401401
/**

0 commit comments

Comments
 (0)