From f37e808e026bcaca748d1abaefaf7efff9ee94da Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 3 Jul 2021 15:47:11 +0000 Subject: [PATCH] Fix test --- src/Model/Post/Media.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Post/Media.php b/src/Model/Post/Media.php index 65cd099f7..90f42a459 100644 --- a/src/Model/Post/Media.php +++ b/src/Model/Post/Media.php @@ -229,7 +229,7 @@ class Media */ private static function fetchLocalData(array $media) { - if (!preg_match('|.*?/photo/(.*[a-fA-F0-9])\-(.*[0-9])\..*[\w]|', $media['url'], $matches)) { + if (!preg_match('|.*?/photo/(.*[a-fA-F0-9])\-(.*[0-9])\..*[\w]|', $media['url'] ?? '', $matches)) { return $media; } $photo = Photo::selectFirst([], ['resource-id' => $matches[1], 'scale' => $matches[2]]); @@ -240,7 +240,7 @@ class Media $media['height'] = $photo['height']; } - if (!preg_match('|.*?/photo/(.*[a-fA-F0-9])\-(.*[0-9])\..*[\w]|', $media['preview'], $matches)) { + if (!preg_match('|.*?/photo/(.*[a-fA-F0-9])\-(.*[0-9])\..*[\w]|', $media['preview'] ?? '', $matches)) { return $media; } $photo = Photo::selectFirst([], ['resource-id' => $matches[1], 'scale' => $matches[2]]);