Skip to content

Commit

Permalink
Merge pull request #313 from jamezp/LOGMGR-276-2.1
Browse files Browse the repository at this point in the history
[LOGMGR-276] Ensure the file is not null before attempting to rotate it.
  • Loading branch information
jamezp authored Jun 8, 2020
2 parents 0ed5c9f + 955cf95 commit 57679bb
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ SuffixRotator getSuffixRotator() {
private void rollOver() {
try {
final File file = getFile();
if (file == null) {
// no file is set; a direct output stream or writer was specified
return;
}
// first, close the original file (some OSes won't let you move/rename a file that is open)
setFileInternal(null);
// next, rotate it
Expand Down

0 comments on commit 57679bb

Please sign in to comment.