Skip to content

Commit

Permalink
Merge pull request #11 from jbwyme/master
Browse files Browse the repository at this point in the history
Fix NullPointerException when retrieving resource paths
  • Loading branch information
codedance committed Feb 3, 2013
2 parents 16b9c4e + a25ec29 commit 0f8c2e3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/main/java/com/papercut/silken/WebAppFileSetResolver.java
Expand Up @@ -93,12 +93,14 @@ private List<URL> listResourcesFromWebDir(String base, String namespace, String
Set<String> files = (Set<String>) servletContext.getResourcePaths(path.toString());

List<URL> resourceList = new ArrayList<URL>();
for (String file : files) {
if (file.endsWith(suffix)) {
try {
resourceList.add(servletContext.getResource(file));
} catch (MalformedURLException e) {
throw new RuntimeException("Unable to resolve resource at: " + file, e);
if (files != null) {
for (String file : files) {
if (file.endsWith(suffix)) {
try {
resourceList.add(servletContext.getResource(file));
} catch (MalformedURLException e) {
throw new RuntimeException("Unable to resolve resource at: " + file, e);
}
}
}
}
Expand Down

0 comments on commit 0f8c2e3

Please sign in to comment.