Fix client crash when an empty message is sent using TextComponent.fromLegacyText
This commit is contained in:
parent
0d7cd78901
commit
b0a8371570
@ -110,6 +110,12 @@ public class TextComponent extends BaseComponent
|
||||
component.setText( builder.toString() );
|
||||
components.add( component );
|
||||
}
|
||||
|
||||
//The client will crash if the array is empty
|
||||
if ( components.size() == 0 ) {
|
||||
components.add( new TextComponent( "" ) );
|
||||
}
|
||||
|
||||
return components.toArray( new BaseComponent[components.size()] );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user