Fix client crash when an empty message is sent using TextComponent.fromLegacyText

This commit is contained in:
Thinkofdeath 2014-01-02 15:39:38 +00:00
parent 0d7cd78901
commit b0a8371570

View File

@ -110,6 +110,12 @@ public class TextComponent extends BaseComponent
component.setText( builder.toString() ); component.setText( builder.toString() );
components.add( component ); 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()] ); return components.toArray( new BaseComponent[components.size()] );
} }