Fixed inability to feature a post on empty db
This commit is contained in:
parent
d4f245e414
commit
99845af35b
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue