From 42b0a82e3fc71d38436249ff9a82e8c3fc96148d Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sat, 20 Aug 2022 02:10:15 +0000 Subject: [PATCH] Check handle before using it --- lib/Db/Util.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Db/Util.php b/lib/Db/Util.php index bd6b8f69..10418a96 100644 --- a/lib/Db/Util.php +++ b/lib/Db/Util.php @@ -34,6 +34,10 @@ class Util { */ public static function getExifFromFile(File &$file) { $handle = $file->fopen('rb'); + if (!$handle) { + throw new \Exception('Could not open file'); + } + $exif = self::getExifFromStream($handle); fclose($handle); return $exif;