Browse Source

Fixes issue 4009

I rewrote the code to disable and enable the buttons a while back, I'll add
this code as a fallback safety measure.

Change-Id: Ia6037f25f5222d6bf954d45f6344a0121a2dfca9
Reviewed-on: http://gerrit.dmdirc.com/1127
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.6.4
Greboid 14 years ago
parent
commit
c4ee8a70ef

+ 3
- 1
src/com/dmdirc/addons/ui_swing/dialogs/profiles/ProfileDetailPanel.java View File

@@ -335,7 +335,9 @@ public final class ProfileDetailPanel extends JPanel implements ActionListener,
335 335
                 /** {@inheritDoc} */
336 336
                 @Override
337 337
                 public boolean save() {
338
-                    nicknames.getModel().removeElementAt(nicknames.getSelectedIndex());
338
+                    if (nicknames.getSelectedIndex() != -1) {
339
+                        nicknames.getModel().removeElementAt(nicknames.getSelectedIndex());
340
+                    }
339 341
                     return true;
340 342
                 }
341 343
 

Loading…
Cancel
Save