Fix bug when using object storage

This commit is contained in:
Kim, Seungho (isho) 2020-08-19 21:11:10 +09:00 committed by GitHub
parent d3c41cf1dd
commit b0a1c0a399
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -37,6 +37,10 @@ class Note {
public function getContent() : string {
$content = $this->file->getContent();
// blank files return false when using object storage as primary storage
if ($content === false && $this->file->getSize() === 0) {
$content = '';
}
if (!is_string($content)) {
throw new \Exception('Can\'t read file content.');
}