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

Loading…
Cancel
Save