r26726 - trunk/freenet/src/freenet/client

[email protected]
Newsgroups gmane.network.freenet.cvs
Message-ID <[email protected]>
Author: toad
Date: 2009-04-10 20:25:57 +0000 (Fri, 10 Apr 2009)
New Revision: 26726

Modified:
   trunk/freenet/src/freenet/client/InsertContext.java
Log:
Paranoia


Modified: trunk/freenet/src/freenet/client/InsertContext.java
===================================================================
--- trunk/freenet/src/freenet/client/InsertContext.java	2009-04-10 20:25:38 UTC (rev 26725)
+++ trunk/freenet/src/freenet/client/InsertContext.java	2009-04-10 20:25:57 UTC (rev 26726)
@@ -7,6 +7,7 @@
 
 import freenet.client.events.ClientEventProducer;
 import freenet.client.events.SimpleEventProducer;
+import freenet.support.Logger;
 import freenet.support.api.BucketFactory;
 import freenet.support.io.PersistentFileTracker;
 
@@ -58,8 +59,12 @@
 	}
 
 	public void removeFrom(ObjectContainer container) {
-		container.activate(eventProducer, 1);
-		eventProducer.removeFrom(container);
+		if(eventProducer == null) {
+			Logger.error(this, "No EventProducer on InsertContext! activated="+container.ext().isActive(this)+" stored="+container.ext().isStored(this), new Exception("error"));
+		} else {
+			container.activate(eventProducer, 1);
+			eventProducer.removeFrom(container);
+		}
 		container.delete(this);
 	}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.