diff --git a/apps/routerconsole/java/src/net/i2p/router/update/PluginUpdateRunner.java b/apps/routerconsole/java/src/net/i2p/router/update/PluginUpdateRunner.java
index 559fa58ca56178bb77f8499dcc5721fc2d23d7a7..4c8c3948182fff7e2847ef81013f84652c45469e 100644
--- a/apps/routerconsole/java/src/net/i2p/router/update/PluginUpdateRunner.java
+++ b/apps/routerconsole/java/src/net/i2p/router/update/PluginUpdateRunner.java
@@ -2,6 +2,7 @@ package net.i2p.router.update;
 
 import java.io.File;
 import java.io.IOException;
+import java.lang.IllegalArgumentException;
 import java.net.URI;
 import java.util.List;
 import java.util.Map;
@@ -37,6 +38,8 @@ import net.i2p.util.VersionComparator;
  * then fetch the first 56 bytes of the URL, extract the version,
  * and compare.
  *
+ * uri list must not be empty.
+ *
  * Moved from web/ and turned into an UpdateTask.
  *
  * @since 0.9.4 moved from PluginUpdateHandler
@@ -55,10 +58,10 @@ class PluginUpdateRunner extends UpdateRunner {
     public static final String PLUGIN_DIR = PluginStarter.PLUGIN_DIR;
 
     public PluginUpdateRunner(RouterContext ctx, ConsoleUpdateManager mgr, List<URI> uris,
-                              String appName, String oldVersion ) { 
+                              String appName, String oldVersion ) {
         super(ctx, mgr, uris);
         if (uris.isEmpty())
-            _uri = null;
+            throw new IllegalArgumentException("uri cannot be empty");
         else
             _uri = uris.get(0);
         _xpi2pURL = _uri.toString();
diff --git a/router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java b/router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java
index 9248df85e52e60c6cc34997cfff8b45bde655f56..55b57bae93abe399f6b6c31aa952897438d71125 100644
--- a/router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java
+++ b/router/java/src/net/i2p/router/peermanager/ProfileOrganizer.java
@@ -184,12 +184,14 @@ public class ProfileOrganizer {
      *
      */
     public PeerProfile addProfile(PeerProfile profile) {
+        if (profile == null) return null;
+
         Hash peer = profile.getPeer();
-        if (profile == null || peer == null) return null;
-        
+        if (peer == null) return null;
+
         if (_log.shouldLog(Log.DEBUG))
             _log.debug("New profile created for " + peer);
-        
+
         PeerProfile old = getProfile(peer);
         profile.coalesceStats();
         if (!getWriteLock())