Browse Source

Potential NPE fix in Channel

git-svn-id: http://svn.dmdirc.com/trunk@2490 00569f92-eb28-0410-84fd-f71c24880f
tags/0.5.5
Chris Smith 16 years ago
parent
commit
84eb1e4831
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      src/com/dmdirc/Channel.java

+ 5
- 3
src/com/dmdirc/Channel.java View File

@@ -360,10 +360,12 @@ public final class Channel extends MessageTarget implements
360 360
      * @param shouldRemove Whether we should remove the window from the server
361 361
      */
362 362
     public void closeWindow(final boolean shouldRemove) {
363
-        final CallbackManager callbackManager = server.getParser().getCallbackManager();
363
+        if (server.getParser() != null) {
364
+            final CallbackManager callbackManager = server.getParser().getCallbackManager();
364 365
         
365
-        for (String callback : CALLBACKS) {
366
-            callbackManager.delCallback(callback, this);
366
+            for (String callback : CALLBACKS) {
367
+                callbackManager.delCallback(callback, this);
368
+            }
367 369
         }
368 370
         
369 371
         ActionManager.processEvent(CoreActionType.CHANNEL_CLOSED, null, this);

Loading…
Cancel
Save