Skip to content

Commit

Permalink
Merge pull request #27032 from nextcloud/bugfix/noid/log-rotation-error
Browse files Browse the repository at this point in the history
Fix filesize error on log rotation, if file does not exist
  • Loading branch information
blizzz authored May 21, 2021
2 parents b900d64 + 40929cb commit 4aae71c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/public/Log/RotationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected function rotate():string {
* @since 14.0.0
*/
protected function shouldRotateBySize():bool {
if ((int)$this->maxSize > 0) {
if ((int)$this->maxSize > 0 && file_exists($this->filePath)) {
$filesize = @filesize($this->filePath);
if ($filesize >= (int)$this->maxSize) {
return true;
Expand Down

0 comments on commit 4aae71c

Please sign in to comment.