Merge pull request #27032 from nextcloud/bugfix/noid/log-rotation-error

Fix filesize error on log rotation, if file does not exist
This commit is contained in:
blizzz 2021-05-21 11:40:40 +02:00 committed by GitHub
commit 4aae71cd77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -58,7 +58,7 @@ trait RotationTrait {
* @since 14.0.0 * @since 14.0.0
*/ */
protected function shouldRotateBySize():bool { protected function shouldRotateBySize():bool {
if ((int)$this->maxSize > 0) { if ((int)$this->maxSize > 0 && file_exists($this->filePath)) {
$filesize = @filesize($this->filePath); $filesize = @filesize($this->filePath);
if ($filesize >= (int)$this->maxSize) { if ($filesize >= (int)$this->maxSize) {
return true; return true;