Add catch for RuntimeException

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>
This commit is contained in:
Daniel Kesselberg 2019-05-17 21:04:01 +02:00
parent a3b4410283
commit b693487d64
No known key found for this signature in database
GPG Key ID: 36E3664E099D0614
1 changed files with 2 additions and 1 deletions

View 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;
}