Author: nextgens
Date: 2007-04-14 17:01:16 +0000 (Sat, 14 Apr 2007)
New Revision: 12701

Modified:
   trunk/freenet/src/freenet/node/fcp/ClientPut.java
Log:
Don't break backward compatibility

Modified: trunk/freenet/src/freenet/node/fcp/ClientPut.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ClientPut.java   2007-04-14 16:52:04 UTC 
(rev 12700)
+++ trunk/freenet/src/freenet/node/fcp/ClientPut.java   2007-04-14 17:01:16 UTC 
(rev 12701)
@@ -279,14 +279,18 @@
                targetFilename = fs.get("TargetFilename");
                this.salt = fs.get(ClientPutBase.SALT);
                String hash = fs.get(ClientPutBase.FILE_HASH);
-               String mySaltedHash = null;
-               try {
-                       mySaltedHash = new String(Base64.decode(hash));
-               } catch (IllegalBase64Exception e) {
-                       throw new PersistenceParseException("Could not read 
FileHash for "+identifier+" : "+e, e);
-               }
-               this.saltedHash = mySaltedHash.getBytes("UTF-8");
+               if(hash != null) {
+                       String mySaltedHash = null;
+                       try {
+                               mySaltedHash = new String(Base64.decode(hash));
+                       } catch (IllegalBase64Exception e) {
+                               throw new PersistenceParseException("Could not 
read FileHash for "+identifier+" : "+e, e);
+                       }
+                       this.saltedHash = mySaltedHash.getBytes("UTF-8");
+               } else
+                       this.saltedHash = null;

+               
                if(uploadFrom == ClientPutMessage.UPLOAD_FROM_DISK) {
                        origFilename = new File(fs.get("Filename"));
                        if(logMINOR)


Reply via email to