Navigation Menu

Skip to content

Commit

Permalink
Another fix for possible NPE in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mareknovotny committed Oct 24, 2017
1 parent c22d678 commit 815af48
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -458,7 +458,8 @@ private static List<Path> expandMultiAppInputDirs(List<Path> input)
}
if (!Files.isDirectory(path))
{
log.warning("Neither a file or directory found in input: " + path.toString());
String pathString = (path == null) ? "" : path.toString();

This comment has been minimized.

Copy link
@jsight

jsight Oct 24, 2017

Member

Files.isDirectory would throw an NPE if path is null. I think this check would be too late in that scenario.

This comment has been minimized.

Copy link
@mareknovotny

mareknovotny Oct 24, 2017

Author Contributor

I would believe that too, but the stacktrace from CI shows it was on logging line. So defensively coding is not against anything ;).

This comment has been minimized.

Copy link
@jsight

jsight Oct 24, 2017

Member

Maybe the code isn't really getting updated when correctly from git? There is really no way for that line to NPE, afaict. At the very least, "path" cannot be null.

log.warning("Neither a file or directory found in input: " + pathString);
continue;
}

Expand Down

0 comments on commit 815af48

Please sign in to comment.