Skip to content

Commit dfc8341

Browse files
committed
WR# 433576: When a file has 0 bytes do not mark it as error
1 parent 665086c commit dfc8341

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

classes/local/store/object_file_system.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ public function readfile(\stored_file $file) {
406406

407407
$this->logger->log_object_read('readfile', $path, $file->get_filesize());
408408

409-
if (!$success) {
409+
if ($success === false) {
410410
manager::update_object_by_hash($file->get_contenthash(), OBJECT_LOCATION_ERROR);
411411
}
412412
}

classes/local/store/s3/file_system.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function readfile(\stored_file $file) {
5959
$this->get_logger()->end_timing();
6060
$this->get_logger()->log_object_read('readfile', $path, $file->get_filesize());
6161

62-
if (!$success) {
62+
if ($success === false) {
6363
manager::update_object_by_hash($file->get_contenthash(), OBJECT_LOCATION_ERROR);
6464
throw new \file_exception('storedfilecannotreadfile', $file->get_filename());
6565
}

0 commit comments

Comments
 (0)