Skip to content

Commit 730303d

Browse files
idodeclareVladimir Kotal
authored andcommitted
Avoid IllegalArgumentException, and log condition
Accommodate a repository that can transiently return errors, such as Perforce when a login expires.
1 parent 22ffbc5 commit 730303d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/search/context/HistoryContext.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ public boolean getContext(File src, String path, Writer out, String context) thr
108108
return false;
109109
}
110110
History hist = HistoryGuru.getInstance().getHistory(src);
111+
if (hist == null) {
112+
LOGGER.log(Level.INFO, "Null history got for {0}", src);
113+
return false;
114+
}
111115
return getHistoryContext(hist, path, out, null, context);
112116
}
113117

0 commit comments

Comments
 (0)