fix #809 avoid ignored NPE
This commit is contained in:
parent
ee3163bad8
commit
144ac3dcea
|
@ -510,6 +510,9 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
// Set dir or WAR
|
||||
resource = context.newResource(context.getWar());
|
||||
}
|
||||
|
||||
if (resource.getURI().getPath()!=null)
|
||||
{
|
||||
String tmp = URIUtil.decodePath(resource.getURI().getPath());
|
||||
if (tmp.endsWith("/"))
|
||||
tmp = tmp.substring(0, tmp.length()-1);
|
||||
|
@ -518,11 +521,12 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
//get just the last part which is the filename
|
||||
int i = tmp.lastIndexOf("/");
|
||||
canonicalName.append(tmp.substring(i+1, tmp.length()));
|
||||
}
|
||||
canonicalName.append("-");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOG.warn("Can't generate resourceBase as part of webapp tmp dir name: " + e);
|
||||
LOG.warn("Can't generate resourceBase as part of webapp tmp dir name "+e);
|
||||
LOG.debug(e);
|
||||
}
|
||||
|
||||
|
@ -552,7 +556,4 @@ public class WebInfConfiguration extends AbstractConfiguration
|
|||
|
||||
return canonicalName.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue