X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FCore.java;h=b21a087f1637155582fe328cd8ddb1a858c29df7;hb=cbaa38f2f223948fcd27950824a4c920a5a90ee9;hp=6f32230b30153a1bbf07d6666fcb3d611b82354f;hpb=5d8f3ac133544177412ec3c533e5f5f92a7b1c35;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 6f32230..b21a087 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -70,6 +70,7 @@ import net.pterodactylus.util.version.Version; import com.google.common.base.Predicate; import com.google.common.collect.Collections2; +import com.google.common.eventbus.EventBus; import com.google.inject.Inject; import freenet.keys.FreenetURI; @@ -96,6 +97,9 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis /** The core listener manager. */ private final CoreListenerManager coreListenerManager = new CoreListenerManager(this); + /** The event bus. */ + private final EventBus eventBus; + /** The configuration. */ private Configuration configuration; @@ -193,9 +197,11 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis * The identity manager * @param webOfTrustUpdater * The WebOfTrust updater + * @param eventBus + * The event bus */ @Inject - public Core(Configuration configuration, FreenetInterface freenetInterface, IdentityManager identityManager, WebOfTrustUpdater webOfTrustUpdater) { + public Core(Configuration configuration, FreenetInterface freenetInterface, IdentityManager identityManager, WebOfTrustUpdater webOfTrustUpdater, EventBus eventBus) { super("Sone Core"); this.configuration = configuration; this.freenetInterface = freenetInterface; @@ -204,6 +210,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis this.imageInserter = new ImageInserter(this, freenetInterface); this.updateChecker = new UpdateChecker(freenetInterface); this.webOfTrustUpdater = webOfTrustUpdater; + this.eventBus = eventBus; } // @@ -419,7 +426,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis sone = new Sone(id, true); sones.put(id, sone); } - if (!sone.isLocal()) { + if ((sone != null) && !sone.isLocal()) { sone = new Sone(id, true); sones.put(id, sone); }