mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
Fix a crash when typing in the search bar ~
This commit is contained in:
parent
05322f1392
commit
ecafafe57e
1 changed files with 7 additions and 2 deletions
|
@ -44,9 +44,14 @@ public class GuiEntry extends GuiBooklet{
|
||||||
this.focusSearch = focusSearch;
|
this.focusSearch = focusSearch;
|
||||||
this.chapters = entry.getChaptersForDisplay(search);
|
this.chapters = entry.getChaptersForDisplay(search);
|
||||||
|
|
||||||
|
if(!this.chapters.isEmpty()){
|
||||||
IBookletChapter lastChap = this.chapters.get(this.chapters.size()-1);
|
IBookletChapter lastChap = this.chapters.get(this.chapters.size()-1);
|
||||||
this.pageAmount = lastChap == null ? 1 : calcEntryPage(this.entry, lastChap, this.searchText)+1;
|
this.pageAmount = lastChap == null ? 1 : calcEntryPage(this.entry, lastChap, this.searchText)+1;
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
this.pageAmount = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public GuiEntry(GuiScreen previousScreen, GuiBookletBase parentPage, IBookletEntry entry, IBookletChapter chapterForPageCalc, String search, boolean focusSearch){
|
public GuiEntry(GuiScreen previousScreen, GuiBookletBase parentPage, IBookletEntry entry, IBookletChapter chapterForPageCalc, String search, boolean focusSearch){
|
||||||
this(previousScreen, parentPage, entry, calcEntryPage(entry, chapterForPageCalc, search), search, focusSearch);
|
this(previousScreen, parentPage, entry, calcEntryPage(entry, chapterForPageCalc, search), search, focusSearch);
|
||||||
|
|
Loading…
Reference in a new issue