* bombe at freenetproject.org <bombe at freenetproject.org> [2008-05-28 
20:09:11]:

> Author: bombe
> Date: 2008-05-28 20:09:11 +0000 (Wed, 28 May 2008)
> New Revision: 20116
> 
> Modified:
>    trunk/freenet/src/freenet/node/fcp/ClientPut.java
> Log:
> use TargetFilename to find a MIME type before trying Identifier
> 
> Modified: trunk/freenet/src/freenet/node/fcp/ClientPut.java
> ===================================================================
> --- trunk/freenet/src/freenet/node/fcp/ClientPut.java 2008-05-28 14:30:01 UTC 
> (rev 20115)
> +++ trunk/freenet/src/freenet/node/fcp/ClientPut.java 2008-05-28 20:09:11 UTC 
> (rev 20116)
> @@ -10,6 +10,7 @@
>  import java.io.UnsupportedEncodingException;
>  import java.net.MalformedURLException;
>  import java.security.MessageDigest;
> +import java.util.Arrays;
>  
>  import freenet.client.ClientMetadata;
>  import freenet.client.DefaultMIMETypes;
> @@ -33,8 +34,6 @@
>  import freenet.support.io.FileBucket;
>  import freenet.support.io.SerializableToFieldSetBucketUtil;
>  
> -import java.util.Arrays;
> -
>  public class ClientPut extends ClientPutBase {
>  
>       final ClientPutter putter;
> @@ -191,6 +190,9 @@
>               if(mimeType == null && origFilename != null) {
>                       mimeType = 
> DefaultMIMETypes.guessMIMEType(origFilename.getName(), true);
>               }
> +             if (mimeType == null) {
> +                     mimeType = 
> DefaultMIMETypes.guessMIMEType(targetFilename, true);
> +             }

I bet that targetFilename can be null and that you're introducing an NPE
here...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20080529/14ed1364/attachment.pgp>

Reply via email to