Skip to content

Commit

Permalink
Fix possible NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
Phoenix616 committed Aug 9, 2021
1 parent fc9b3f2 commit c90c780
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public ComponentBuilder parse(String message) throws IllegalArgumentException {
if (encoded != null && encoded.size() == 1) {
Map.Entry<TextFormat, Boolean> single = encoded.entrySet().iterator().next();
if (single.getKey() == Util.TextControl.RESET) {
if (builder() == null && (!format().isEmpty() || !colors().isEmpty())) {
if (builder() == null && ((format() != null && !format().isEmpty()) || (colors() != null && !colors().isEmpty()))) {
builder(Component.text());
}
appendValue();
Expand All @@ -235,7 +235,7 @@ public ComponentBuilder parse(String message) throws IllegalArgumentException {
format(new HashMap<>());
} else if (single.getKey() instanceof TextColor) {
if (value().length() > 0) {
if (builder() == null && !format().isEmpty()) {
if (builder() == null && format() != null && !format().isEmpty()) {
builder(Component.text());
}
appendValue();
Expand Down

0 comments on commit c90c780

Please sign in to comment.