Skip to content

Commit

Permalink
Fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
timkelty committed Feb 9, 2024
1 parent 77938b2 commit 7bff9d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/StaticCaching.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ public function handleAfterRenderPageTemplate(TemplateEvent $event): void
/** @var int|null $duration */
[$dependency, $duration] = Craft::$app->getElements()->stopCollectingCacheInfo();

$this->addCacheTagsToResponse($dependency?->tags, $duration);
if ($dependency?->tags) {
$this->addCacheTagsToResponse($dependency->tags, $duration);
}
}

public function handleInvalidateCaches(InvalidateElementCachesEvent $event): void
Expand Down

0 comments on commit 7bff9d9

Please sign in to comment.