File tree Expand file tree Collapse file tree
src/main/java/com/cleanroommc/modularui/drawable/text Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55import org .jetbrains .annotations .Nullable ;
66
7- import java .util .Objects ;
87import java .util .function .Supplier ;
98
109public 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 ()));
You can’t perform that action at this time.
0 commit comments