From 23843c3deda46b75875b6d3bee5061a6e003b124 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Fri, 29 Sep 2023 18:52:03 -0700 Subject: [PATCH] exif: resume on failure to get file (fix #820) Signed-off-by: Varun Patil --- lib/Exif.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/Exif.php b/lib/Exif.php index 93e84732..e535e4cf 100644 --- a/lib/Exif.php +++ b/lib/Exif.php @@ -68,9 +68,15 @@ class Exif /** * Get exif data as a JSON object from a Nextcloud file. */ - public static function getExifFromFile(File &$file) + public static function getExifFromFile(File $file) { - $path = $file->getStorage()->getLocalFile($file->getInternalPath()); + try { + $path = $file->getStorage()->getLocalFile($file->getInternalPath()); + } catch (\Throwable $ex) { + // https://github.com/pulsejet/memories/issues/820 + throw new \Exception('Failed to get local file: '.$ex->getMessage()); + } + if (!\is_string($path)) { throw new \Exception('Failed to get local file path'); }