From: David ‘Bombe’ Roden Date: Mon, 28 Jan 2013 21:45:43 +0000 (+0100) Subject: Prevent NPE when creating a new Sone. X-Git-Tag: 0.8.5^2~3^2~36 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;ds=sidebyside;h=ebc0b716ae43fa19036497517d55d431a4765f70;hp=6910cc36c137a5d5cd47f71694d5511f7574bbdf;p=Sone.git Prevent NPE when creating a new Sone. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 4a71e53..b2188e0 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -802,6 +802,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, sone.setClient(new Client("Sone", SonePlugin.VERSION.toString())); sone.setKnown(true); /* TODO - load posts ’n stuff */ + trustedIdentities.put(ownIdentity, Collections.synchronizedSet(new HashSet())); sones.put(ownIdentity.getId(), sone); final SoneInserter soneInserter = new SoneInserter(this, eventBus, freenetInterface, sone); soneInserters.put(sone, soneInserter); @@ -2236,7 +2237,6 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, OwnIdentity ownIdentity = ownIdentityAddedEvent.ownIdentity(); logger.log(Level.FINEST, String.format("Adding OwnIdentity: %s", ownIdentity)); if (ownIdentity.hasContext("Sone")) { - trustedIdentities.put(ownIdentity, Collections.synchronizedSet(new HashSet())); addLocalSone(ownIdentity); } }