Skip to content

Commit ad4ef47

Browse files
Vladimir Kotalvladak
authored andcommitted
check write object to be non null before calling close on it
1 parent a999dfc commit ad4ef47

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/org/opensolaris/opengrok/history/FileHistoryCache.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,9 @@ private void storeLatestCachedRevision(Repository repository, String rev) {
592592
ex.getCause());
593593
} finally {
594594
try {
595-
writer.close();
595+
if (writer != null) {
596+
writer.close();
597+
}
596598
} catch (IOException ex) {
597599
logger.log(Level.INFO, "cannot close file: " + ex);
598600
}

0 commit comments

Comments
 (0)