diff --git a/app/PccSyncManager.php b/app/PccSyncManager.php index c0fa7e3..62202fe 100644 --- a/app/PccSyncManager.php +++ b/app/PccSyncManager.php @@ -191,12 +191,12 @@ private function setPostFeatureImage($postId, Article $article) return; } // If the feature image is empty, delete the existing thumbnail. - $featuredImageURL = $article->metadata['FeaturedImage'] . '#image.jpg'; - if (!$featuredImageURL) { + if (!$article->metadata['FeaturedImage']) { delete_post_thumbnail($postId); return; } + $featuredImageURL = $article->metadata['FeaturedImage'] . '#image.jpg'; // Check if there was an existing image. $existingImageId = $this->getImageIdByUrl($featuredImageURL); if ($existingImageId) {