Don’t change the configuration after starting the core.
[Sone.git] / src / main / java / net / pterodactylus / sone / main / SonePlugin.java
index e31bbf5..9d31b35 100644 (file)
@@ -104,7 +104,7 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
        }
 
        /** The version. */
-       public static final Version VERSION = new Version(0, 8, 7);
+       public static final Version VERSION = new Version(0, 8, 9);
 
        /** The logger. */
        private static final Logger logger = Logging.getLogger(SonePlugin.class);
@@ -195,7 +195,13 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
                        }
                }
 
-               final Configuration startConfiguration = oldConfiguration;
+               final Configuration startConfiguration;
+               if ((newConfiguration != null) && (oldConfiguration != newConfiguration)) {
+                       logger.log(Level.INFO, "Setting configuration to file-based configuration.");
+                       startConfiguration = newConfiguration;
+               } else {
+                       startConfiguration = oldConfiguration;
+               }
                final EventBus eventBus = new EventBus();
 
                /* Freenet injector configuration. */
@@ -264,10 +270,6 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
 
                        /* start core! */
                        core.start();
-                       if ((newConfiguration != null) && (oldConfiguration != newConfiguration)) {
-                               logger.log(Level.INFO, "Setting configuration to file-based configuration.");
-                               core.setConfiguration(newConfiguration);
-                       }
                        webInterface.start();
                        webInterface.setFirstStart(firstStart);
                        webInterface.setNewConfig(newConfig);