From 8081d053cc360388037a5be1ce7abab77c110524 Mon Sep 17 00:00:00 2001 From: zzz Date: Sat, 27 Feb 2010 14:38:52 +0000 Subject: [PATCH] Prevent UDP startup NPE http://zzz.i2p/topics/571 --- history.txt | 2 ++ router/java/src/net/i2p/router/RouterVersion.java | 2 +- .../java/src/net/i2p/router/transport/udp/UDPTransport.java | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/history.txt b/history.txt index a67132e124..83731b0ca5 100644 --- a/history.txt +++ b/history.txt @@ -6,6 +6,7 @@ - Fix http://i2p/b64/ and /eepproxy/site/ requests - Disallow a port specified for an i2p address - Cleanup and comments + - For more info see http://zzz.i2p/topics/566 * i2psnark: - Fix NPE after create file failure - Sanitize more characters in file names @@ -21,6 +22,7 @@ - Don't instantiate and start TWPMQ Cleaner and OutboundRefiller threads, part of priority queues unused since 0.6.1.11 - Don't instantiate and start UDPFlooder, it is for testing only + - Prevent NPE http://zzz.i2p/topics/571 2010-02-23 zzz * Unzip: Any files in the zip with a .jar.pack or .war.pack extension diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index e72c467bc1..9276ceebc0 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 6; + public final static long BUILD = 7; /** for example "-test" */ public final static String EXTRA = ""; diff --git a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java index 81b2e209b9..853d8c18ae 100644 --- a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java +++ b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java @@ -1264,7 +1264,9 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority options.setProperty(UDPAddress.PROP_CAPACITY, ""+UDPAddress.CAPACITY_TESTING + UDPAddress.CAPACITY_INTRODUCER); if (directIncluded || introducersIncluded) { - options.setProperty(UDPAddress.PROP_INTRO_KEY, _introKey.toBase64()); + // This is called via TransportManager.configTransports() before startup(), prevent NPE + if (_introKey != null) + options.setProperty(UDPAddress.PROP_INTRO_KEY, _introKey.toBase64()); RouterAddress addr = new RouterAddress(); if (ADJUST_COST && !haveCapacity())