Author: toad
Date: 2008-06-25 15:17:35 +0000 (Wed, 25 Jun 2008)
New Revision: 20688

Modified:
   branches/db4o/freenet/src/freenet/keys/Key.java
Log:
Paranoia

Modified: branches/db4o/freenet/src/freenet/keys/Key.java
===================================================================
--- branches/db4o/freenet/src/freenet/keys/Key.java     2008-06-25 15:16:33 UTC 
(rev 20687)
+++ branches/db4o/freenet/src/freenet/keys/Key.java     2008-06-25 15:17:35 UTC 
(rev 20688)
@@ -97,6 +97,7 @@
     public synchronized double toNormalizedDouble() {
         if(cachedNormalizedDouble > 0) return cachedNormalizedDouble;
         MessageDigest md = SHA256.getMessageDigest();
+        if(routingKey == null) throw new NullPointerException();
         md.update(routingKey);
         int TYPE = getType();
         md.update((byte)(TYPE >> 8));


Reply via email to