Skip to content

Commit

Permalink
guard against null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
chenson42 committed Dec 23, 2014
1 parent 8d17268 commit 8ed5360
Showing 1 changed file with 6 additions and 3 deletions.
Expand Up @@ -119,14 +119,17 @@ public void purgeOlderThan(long time) {
purgeOlderThan(time, warningByEngineByMessage);
}

protected void purgeOlderThan(long time, Map<String, Map<String, LogSummary>> logSummaryByEngineByMessage) {
protected void purgeOlderThan(long time,
Map<String, Map<String, LogSummary>> logSummaryByEngineByMessage) {
Collection<Map<String, LogSummary>> all = logSummaryByEngineByMessage.values();
for (Map<String, LogSummary> map : all) {
Set<String> keys = map.keySet();
for (String key : keys) {
LogSummary summary = map.get(key);
if (summary.getMostRecentTime() < time) {
map.remove(key);
if (summary != null) {
if (summary.getMostRecentTime() < time) {
map.remove(key);
}
}
}
}
Expand Down

0 comments on commit 8ed5360

Please sign in to comment.