]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add catch for RuntimeException
authorDaniel Kesselberg <mail@danielkesselberg.de>
Fri, 17 May 2019 19:04:01 +0000 (21:04 +0200)
committerBackportbot <backportbot-noreply@rullzer.com>
Tue, 16 Jul 2019 06:06:01 +0000 (06:06 +0000)
getDirectoryListing can throw a NotFoundException or a RuntimeException.
The repair step should be skipped if the cache directory is missing so
a catch for both exceptions is required.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
lib/private/Repair/NC16/CleanupCardDAVPhotoCache.php

index c9c7b5cf1c0ed11c09df693b881e289d8238376e..92ffcb54742e7046ce35c3f351c2b3f057689f37 100644 (file)
@@ -29,6 +29,7 @@ use OCP\IConfig;
 use OCP\ILogger;
 use OCP\Migration\IOutput;
 use OCP\Migration\IRepairStep;
+use RuntimeException;
 
 /**
  * Class CleanupCardDAVPhotoCache
@@ -63,7 +64,7 @@ class CleanupCardDAVPhotoCache implements IRepairStep {
        private function repair(IOutput $output): void {
                try {
                        $folders = $this->appData->getDirectoryListing();
-               } catch (NotFoundException $e) {
+               } catch (NotFoundException|RuntimeException $e) {
                        return;
                }