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 committed by Backportbot
parent 988df2d2e9
commit c208ea49d4
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;
}