Skip to content

Commit

Permalink
Merge pull request #562 from dcrissman/NPE
Browse files Browse the repository at this point in the history
throw appropriate exception indicating missing file
  • Loading branch information
paterczm committed Jan 12, 2016
2 parents 6e66d91 + 593dba0 commit d94608c
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -70,6 +70,9 @@ public static final String loadResource(String resourceName) throws IOException
*/
public static final String loadResource(String resourceName, ClassLoader loader) throws IOException {
try (InputStream is = loader.getResourceAsStream(resourceName)) {
if (null == is) {
throw new FileNotFoundException(resourceName);
}
return loadResource(is);
}
}
Expand Down

0 comments on commit d94608c

Please sign in to comment.