]> source.dussan.org Git - nextcloud-server.git/commitdiff
skip files that cant be opened for FixEncryptedVersion 35337/head
authorRobin Appelman <robin@icewind.nl>
Tue, 22 Nov 2022 15:40:12 +0000 (16:40 +0100)
committerRobin Appelman <robin@icewind.nl>
Tue, 22 Nov 2022 15:40:12 +0000 (16:40 +0100)
Signed-off-by: Robin Appelman <robin@icewind.nl>
apps/encryption/lib/Command/FixEncryptedVersion.php

index d4c5eddbfe5ab845ecb8552c1c8fb7ac31b72301..ab9cc528c54be84f713318f0f8acce95c380ef9f 100644 (file)
@@ -174,6 +174,11 @@ class FixEncryptedVersion extends Command {
                         */
                        $handle = $this->view->fopen($path, 'rb');
 
+                       if ($handle === false) {
+                               $output->writeln("<warning>Failed to open file: \"$path\" skipping</warning>");
+                               return true;
+                       }
+
                        if (\fread($handle, 9001) !== false) {
                                $fileInfo = $this->view->getFileInfo($path);
                                if (!$fileInfo) {