Merge pull request #935 from yawkat/fix-legacy-convert-npe

Fix NPE when converting invalid color character from legacy text (Fixes #934)
This commit is contained in:
thinkofdeath 2014-03-15 19:24:00 +00:00
commit a8584f81ed

View File

@ -46,6 +46,8 @@ public class TextComponent extends BaseComponent
{
c += 32;
}
ChatColor format = ChatColor.getByChar( c );
if ( format == null ) continue;
if ( builder.length() > 0 )
{
TextComponent old = component;
@ -54,7 +56,6 @@ public class TextComponent extends BaseComponent
builder = new StringBuilder();
components.add( old );
}
ChatColor format = ChatColor.getByChar( c );
switch ( format )
{
case BOLD: