Переглянути джерело

Fix Greboid-induced NPE in fdnotify plugin

Fixes issue 3517

Change-Id: Ia8c3cd8a4bedeaced1c61aee0121450c6663212f
Reviewed-on: http://gerrit.dmdirc.com/514
Automatic-Compile: Gregory Holmes <greboid@dmdirc.com>
Reviewed-by: Gregory Holmes <greboid@dmdirc.com>
tags/0.6.3
Chris Smith 14 роки тому
джерело
коміт
a693967932

+ 4
- 3
src/com/dmdirc/addons/freedesktop_notifications/FreeDesktopNotificationsPlugin.java Переглянути файл

@@ -71,9 +71,6 @@ public final class FreeDesktopNotificationsPlugin extends Plugin implements
71 71
      */
72 72
     public FreeDesktopNotificationsPlugin() {
73 73
         super();
74
-
75
-        IdentityManager.getGlobalConfig().addChangeListener(getDomain(), this);
76
-        setCachedSettings();
77 74
     }
78 75
 
79 76
     /**
@@ -145,6 +142,9 @@ public final class FreeDesktopNotificationsPlugin extends Plugin implements
145 142
      */
146 143
     @Override
147 144
     public void onLoad() {
145
+        IdentityManager.getGlobalConfig().addChangeListener(getDomain(), this);
146
+        setCachedSettings();
147
+
148 148
         command = new FDNotifyCommand(this);
149 149
 
150 150
         // Extract required Files
@@ -181,6 +181,7 @@ public final class FreeDesktopNotificationsPlugin extends Plugin implements
181 181
     @Override
182 182
     public synchronized void onUnload() {
183 183
         CommandManager.unregisterCommand(command);
184
+        IdentityManager.getGlobalConfig().removeListener(this);
184 185
     }
185 186
     
186 187
     /** {@inheritDoc} */

Завантаження…
Відмінити
Зберегти