Fix a null pointer exception if the user cancel a color pickup

cusax-fix
Benoit Pradelle 18 years ago
parent fc763d2c36
commit e4f0e74e47

@ -203,18 +203,20 @@ public void mousePressed(MouseEvent event)
"Choose a colour",
colorLabel.getBackground());
colorLabel.setBackground(newColor);
ActionEvent evt =
new ActionEvent(chatEditorPane,
ActionEvent.ACTION_PERFORMED, "");
Action action =
new HTMLEditorKit.ForegroundAction(new Integer(newColor
.getRGB()).toString(), newColor);
action.actionPerformed(evt);
if (newColor != null) {
colorLabel.setBackground(newColor);
ActionEvent evt =
new ActionEvent(chatEditorPane,
ActionEvent.ACTION_PERFORMED, "");
Action action =
new HTMLEditorKit.ForegroundAction(new Integer(newColor
.getRGB()).toString(), newColor);
action.actionPerformed(evt);
}
chatEditorPane.requestFocus();
}
});

Loading…
Cancel
Save