diff --git a/src/Services/PostFeatureService.php b/src/Services/PostFeatureService.php index d48d5001..17486596 100644 --- a/src/Services/PostFeatureService.php +++ b/src/Services/PostFeatureService.php @@ -69,7 +69,7 @@ class PostFeatureService { $previousFeaturedPost = $this->getFeaturedPost(); - if ($previousFeaturedPost->getId() !== $post->getId()) + if (($previousFeaturedPost === null) or ($previousFeaturedPost->getId() !== $post->getId())) { $post->setLastFeatureTime($this->timeService->getCurrentTime()); $post->setFeatureCount($post->getFeatureCount() + 1);