Author: toad
Date: 2007-11-17 22:22:47 +0000 (Sat, 17 Nov 2007)
New Revision: 15803
Modified:
trunk/freenet/src/freenet/node/NodeDispatcher.java
Log:
Fix NPE when finishing a request trace. Thanks Anonymous.
Modified: trunk/freenet/src/freenet/node/NodeDispatcher.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeDispatcher.java 2007-11-17 22:20:12 UTC
(rev 15802)
+++ trunk/freenet/src/freenet/node/NodeDispatcher.java 2007-11-17 22:22:47 UTC
(rev 15803)
@@ -867,7 +867,8 @@
Message sub = m.getSubMessage(DMT.FNPBestRoutesNotTaken);
try {
- // Send a completion trace
+ if(origSource != null) {
+ // Send a completion trace - before forking
PeerNode[] peers = node.getConnectedPeers();
Message trace =
DMT.createFNPProbeTrace(id, target, nearest,
best, ctx.htl, counter, node.getLocation(), node.swapIdentifier,
LocationManager.extractLocs(peers, true), LocationManager.extractUIDs(peers),
ctx.forkCount, linearCounter, "replying", src == null ? -1 :
src.swapIdentifier);
@@ -877,6 +878,7 @@
} catch (NotConnectedException e1) {
// Ignore
}
+ }
} catch (Throwable t) {
Logger.error(this, "Could not send completion trace:
"+t, t);
}