From 255ef832ac0471b52b90869ac3754f770917069f Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sat, 7 Oct 2023 08:18:21 -0700 Subject: [PATCH] migration: fix when exif is null (fix #848) Signed-off-by: Varun Patil --- lib/Migration/Version505000Date20230821044807.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Migration/Version505000Date20230821044807.php b/lib/Migration/Version505000Date20230821044807.php index 4d3ea695..b99aeb1f 100644 --- a/lib/Migration/Version505000Date20230821044807.php +++ b/lib/Migration/Version505000Date20230821044807.php @@ -95,6 +95,11 @@ class Version505000Date20230821044807 extends SimpleMigrationStep $this->dbc->beginTransaction(); while ($row = $result->fetch()) { try { + // try to get the exif string + if (!\is_array($row) || !\array_key_exists('exif', $row) || !\is_string($row['exif'])) { + continue; + } + // get the epoch from the exif data $exif = json_decode($row['exif'], true); if (!\is_array($exif) || !\array_key_exists('DateTimeEpoch', $exif)) {