migration: fix when exif is null (fix #848)

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/807/merge
Varun Patil 2023-10-07 08:18:21 -07:00
parent 61294a7dc3
commit 255ef832ac
1 changed files with 5 additions and 0 deletions

View File

@ -95,6 +95,11 @@ class Version505000Date20230821044807 extends SimpleMigrationStep
$this->dbc->beginTransaction(); $this->dbc->beginTransaction();
while ($row = $result->fetch()) { while ($row = $result->fetch()) {
try { 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 // get the epoch from the exif data
$exif = json_decode($row['exif'], true); $exif = json_decode($row['exif'], true);
if (!\is_array($exif) || !\array_key_exists('DateTimeEpoch', $exif)) { if (!\is_array($exif) || !\array_key_exists('DateTimeEpoch', $exif)) {