Skip to content

Commit e8a0889

Browse files
committed
potentially fix server side issue with dynamic key
1 parent 34dd086 commit e8a0889

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/main/java/com/cleanroommc/modularui/drawable/text/DynamicKey.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44

55
import org.jetbrains.annotations.Nullable;
66

7-
import java.util.Objects;
87
import java.util.function.Supplier;
98

109
public class DynamicKey extends BaseKey {
1110

1211
private final Supplier<IKey> supplier;
1312

1413
public DynamicKey(Supplier<IKey> supplier) {
15-
Objects.requireNonNull(supplier.get(), "IKey returns a null key!");
1614
this.supplier = supplier;
1715
}
1816

@@ -29,6 +27,7 @@ public String getFormatted(@Nullable FormattingState parentFormatting) {
2927

3028
private String toString(boolean formatted, @Nullable FormattingState parentFormatting) {
3129
IKey key = this.supplier.get();
30+
if (key == null) key = IKey.EMPTY;
3231
if (formatted) {
3332
// merge parent formatting and this formatting to no lose info
3433
return key.getFormatted(FormattingState.merge(parentFormatting, getFormatting()));

0 commit comments

Comments
 (0)