Author: toad
Date: 2008-07-18 21:25:10 +0000 (Fri, 18 Jul 2008)
New Revision: 21226

Modified:
   branches/db4o/freenet/src/freenet/client/async/ChosenRequest.java
Log:
Use cloneKey() for both Key's and ClientKey's. Prevents NPEs given the other 
changes involving deactivation of keys.

Modified: branches/db4o/freenet/src/freenet/client/async/ChosenRequest.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/ChosenRequest.java   
2008-07-18 21:24:20 UTC (rev 21225)
+++ branches/db4o/freenet/src/freenet/client/async/ChosenRequest.java   
2008-07-18 21:25:10 UTC (rev 21226)
@@ -35,8 +35,14 @@
        ChosenRequest(SendableRequest req, Object tok, Key key, ClientKey ckey, 
short prio) {
                request = req;
                token = tok;
-               this.key = key;
-               this.ckey = ckey;
+               if(key != null)
+                       this.key = key.cloneKey();
+               else
+                       this.key = null;
+               if(ckey != null)
+                       this.ckey = ckey.cloneKey();
+               else
+                       this.ckey = null;
                this.prio = prio;
                if(req instanceof SendableGet) {
                        SendableGet sg = (SendableGet) req;


Reply via email to