[ 
https://issues.apache.org/jira/browse/IVY-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Maarten Coene updated IVY-1400:
-------------------------------

    Fix Version/s:     (was: 2.4.0)
                   2.4.0-RC1

> NullPointerException - problem while listing resources
> ------------------------------------------------------
>
>                 Key: IVY-1400
>                 URL: https://issues.apache.org/jira/browse/IVY-1400
>             Project: Ivy
>          Issue Type: Bug
>    Affects Versions: 2.3.0
>            Reporter: Frédéric RIVIERE
>            Assignee: Maarten Coene
>            Priority: Minor
>             Fix For: 2.4.0-RC1
>
>
> After debugging, the problem appears when using 
> org.apache.ivy.util.url.HttpClientHandler (connecting jakarta commons http 
> client). 
> A check is missing in getURLInfo() when web server does not return 
> content-type in HTTP header. Line 156, 
> method.getResponseHeader("content-type") returns null so NPE occurs when 
> calling getValue().
> Works fine with BasicURLHandler.
> Should be something like:
> public URLInfo getURLInfo(URL url, int timeout) {
>        ...
> if (checkStatusCode(url, method)) {
>                 HttpResponseHeader h = 
> method.getResponseHeader("content-type");
>                 String contentType = h == null ? null : h.getValue();
>                 String bodyCharset = 
> BasicURLHandler.getCharSetFromContentType(contentType);
> ...



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to