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]]);