Skip to content

Commit

Permalink
Fix NullPointerException when Logger is removed while looping (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
tntim96 committed Mar 30, 2016
1 parent 89ffb42 commit de06770
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions History.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Upgrade to Rhino 1.7.7.1
* Improve Logic To Determine Inverted Mode (https://github.com/tntim96/JSCover/issues/223)
* Don't Switch To Inverted Mode If There's A Query String (https://github.com/tntim96/JSCover/issues/222)
* Fix NullPointerException when Logger is removed while looping (https://github.com/tntim96/JSCover/pull/225)
* Internal: Upgrade HtmlUnit 2.19 to 2.20

1.0.23 / 2016-01-03
Expand Down
8 changes: 2 additions & 6 deletions src/main/java/jscover/util/LoggerUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,7 @@ private void alterLoggers(Level level, File file) throws IOException {
while (names.hasMoreElements()) {
String loggerName = names.nextElement();
Logger logger = LogManager.getLogManager().getLogger(loggerName);
if (logger == null) {
continue;
}
if (logger == null) continue;
logger.setLevel(level);
logger.addHandler(fileTxt);
Handler[] handlers = logger.getHandlers();
Expand All @@ -404,9 +402,7 @@ private void addExceptionRecorder() {
while (names.hasMoreElements()) {
String loggerName = names.nextElement();
Logger logger = LogManager.getLogManager().getLogger(loggerName);
if (logger == null) {
continue;
}
if (logger == null) continue;
logger.addHandler(exceptionRecordingHandler);
}
}
Expand Down

0 comments on commit de06770

Please sign in to comment.