Skip to content

Commit

Permalink
Only bust category cache if there is a category.
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanThompson committed Jan 4, 2019
1 parent 08e23c2 commit 92ba254
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Post/PostObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ public function saved(EntryInterface $entry)
$this->dispatch(new PurgePostCache($entry));
$this->dispatch(new PurgeIndexCache($entry));

$this->dispatch(new PurgeCategoryCache($entry->getCategory()));
if ($category = $entry->getCategory()) {
$this->dispatch(new PurgeCategoryCache($category));
}

parent::saved($entry);
}
Expand Down

0 comments on commit 92ba254

Please sign in to comment.