Skip to content

Commit 07c03c0

Browse files
committed
check null before check string
1 parent d246fb6 commit 07c03c0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/me/hsgamer/bettergui/button/WrappedPredicateButton.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ public StringReplacer getStringReplacer() {
187187
return Pair.of(((MenuButton) button).getStringReplacer(), original.substring("fallback".length()));
188188
}
189189
}
190-
if (original.startsWith("click") && getClickRequirements() != null) {
190+
if (getClickRequirements() != null && original.startsWith("click")) {
191191
return Pair.of(getClickRequirements().getStringReplacer(), original.substring("click".length()));
192192
}
193-
if (original.startsWith("view") && getViewRequirement() != null) {
193+
if (getViewRequirement() != null && original.startsWith("view")) {
194194
return Pair.of(getViewRequirement().getStringReplacer(), original.substring("view".length()));
195195
}
196196
return null;

0 commit comments

Comments
 (0)