Skip to content

Commit 74d93b3

Browse files
author
Francisco Solis
committed
Fixed NPE Spam
1 parent 624ff89 commit 74d93b3

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## v5.0.4 Changelog
2+
```
3+
* Fixed NullPointerException Spam
4+
```
5+
16
## v5.0.3 Changelog:
27
```
38
* Added missing search term argument

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>xyz.theprogramsrc</groupId>
88
<artifactId>SuperCoreAPI</artifactId>
9-
<version>5.0.3</version>
9+
<version>5.0.4</version>
1010
<packaging>jar</packaging>
1111

1212
<name>SuperCoreAPI</name>

src/main/java/xyz/theprogramsrc/supercoreapi/spigot/guis/BrowserGUI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public boolean onItemSearch(OBJ obj, String searchTerm){
4040

4141
@Override
4242
protected GUIButton[] getButtons() {
43-
List<OBJ> objectsFound = Arrays.stream(this.getObjects()).filter(obj -> this.onItemSearch(obj, this.searchTerm)).collect(Collectors.toList());
43+
List<OBJ> objectsFound = Arrays.stream(this.getObjects()).filter(obj -> this.onItemSearch(obj, this.searchTerm != null ? this.searchTerm : "")).collect(Collectors.toList());
4444
int index0 = this.page * this.maxItemsPerPage;
4545
int index1 = Math.min(index0 + this.maxItemsPerPage, objectsFound.size());
4646
int maxPages = (int)Math.round(Math.ceil((double)objectsFound.size() / (double)maxItemsPerPage));

0 commit comments

Comments
 (0)