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++;
|
i++;
|
||||||
c = message.charAt( i );
|
c = message.charAt( i );
|
||||||
|
ChatColor format = ChatColor.getByChar( c );
|
||||||
|
if ( format == null ) continue;
|
||||||
if ( c >= 'A' && c <= 'Z' )
|
if ( c >= 'A' && c <= 'Z' )
|
||||||
{
|
{
|
||||||
c += 32;
|
c += 32;
|
||||||
@ -54,7 +56,6 @@ public class TextComponent extends BaseComponent
|
|||||||
builder = new StringBuilder();
|
builder = new StringBuilder();
|
||||||
components.add( old );
|
components.add( old );
|
||||||
}
|
}
|
||||||
ChatColor format = ChatColor.getByChar( c );
|
|
||||||
switch ( format )
|
switch ( format )
|
||||||
{
|
{
|
||||||
case BOLD:
|
case BOLD:
|
||||||
|
Loading…
Reference in New Issue
Block a user