]> source.dussan.org Git - nextcloud-server.git/commitdiff
Handle possible null value for file in OC\Files\SimpleFS\NewSimpleFile 35576/head
authorThomas Citharel <tcit@tcit.fr>
Sat, 3 Dec 2022 16:25:32 +0000 (17:25 +0100)
committerThomas Citharel <tcit@tcit.fr>
Sat, 3 Dec 2022 16:25:32 +0000 (17:25 +0100)
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
lib/private/Files/SimpleFS/NewSimpleFile.php

index b2a183b7d29798366095cfd16c286e60e04e802d..e2d1ae274b16d82a352a84e412ade7f69a78abc7 100644 (file)
@@ -136,6 +136,10 @@ class NewSimpleFile implements ISimpleFile {
         * @throws NotFoundException
         */
        private function checkFile(): void {
+               if (!$this->file) {
+                       throw new NotFoundException('File not set');
+               }
+
                $cur = $this->file;
 
                while ($cur->stat() === false) {