Fix NPE when converting invalid color character from legacy text
This commit is contained in:
parent
92ebce2ec6
commit
c29676e4fc
@ -42,6 +42,8 @@ public class TextComponent extends BaseComponent
|
||||
{
|
||||
i++;
|
||||
c = message.charAt( i );
|
||||
ChatColor format = ChatColor.getByChar( c );
|
||||
if ( format == null ) continue;
|
||||
if ( c >= 'A' && c <= 'Z' )
|
||||
{
|
||||
c += 32;
|
||||
@ -54,7 +56,6 @@ public class TextComponent extends BaseComponent
|
||||
builder = new StringBuilder();
|
||||
components.add( old );
|
||||
}
|
||||
ChatColor format = ChatColor.getByChar( c );
|
||||
switch ( format )
|
||||
{
|
||||
case BOLD:
|
||||
|
Loading…
Reference in New Issue
Block a user