Преглед изворни кода

Check colours aren't null before comparing

Fixes issue 3755

Change-Id: Id90ea1a61c6f76d7788bc15fbbc9b6e0f47679db
Reviewed-on: http://gerrit.dmdirc.com/875
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.6.3
Gregory Holmes пре 14 година
родитељ
комит
0be27514a7

+ 4
- 2
src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/TopicLabel.java Прегледај датотеку

@@ -152,7 +152,8 @@ public class TopicLabel extends JPanel {
152 152
     @Override
153 153
     public void setBackground(final Color bg) {
154 154
         super.setBackground(bg);
155
-        if (topic != null && !bg.equals(getBackground())) {
155
+        if (topic != null && ((bg == null && getBackground() != null) ||
156
+                !bg.equals(getBackground()))) {
156 157
             init();
157 158
         }
158 159
     }
@@ -161,7 +162,8 @@ public class TopicLabel extends JPanel {
161 162
     @Override
162 163
     public void setForeground(final Color fg) {
163 164
         super.setForeground(fg);
164
-        if (topic != null && !fg.equals(getForeground())) {
165
+        if (topic != null && ((fg == null && getForeground() != null) ||
166
+                !fg.equals(getForeground()))) {
165 167
             init();
166 168
         }
167 169
     }

Loading…
Откажи
Сачувај