Inverted if-condition for simplification.

fix-message-formatting
Danny van Heumen 11 years ago
parent ab018c18fa
commit 9aff5aa6bc

@ -87,7 +87,11 @@ public static String parseIrcMessage(final String text)
case ControlChar.ColorFormat.CODE: case ControlChar.ColorFormat.CODE:
// first parse foreground color code // first parse foreground color code
Color foreground = parseForegroundColor(text.substring(i + 1)); Color foreground = parseForegroundColor(text.substring(i + 1));
if (foreground != null) if (foreground == null)
{
builder.cancel(ControlChar.ColorFormat.class, false);
}
else
{ {
i += 2; i += 2;
Color background = Color background =
@ -99,10 +103,6 @@ public static String parseIrcMessage(final String text)
builder.apply(new ControlChar.ColorFormat(foreground, builder.apply(new ControlChar.ColorFormat(foreground,
background)); background));
} }
else
{
builder.cancel(ControlChar.ColorFormat.class, false);
}
break; break;
case ControlChar.Normal.CODE: case ControlChar.Normal.CODE:
builder.cancelAll(); builder.cancelAll();

Loading…
Cancel
Save