Skip to content

Commit

Permalink
Allow no nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
timkelty committed May 10, 2024
1 parent 9e0af26 commit b56d22f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/web/twig/nodes/CacheResponseNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ class CacheResponseNode extends Node
*/
public function compile(Compiler $compiler): void
{
$duration = self::durationInSeconds(
$this->getAttribute('durationNum'),
$durationNum = $this->getAttribute('durationNum');

$duration = $durationNum === null ? null : self::durationInSeconds(
$durationNum,
$this->getAttribute('durationUnit'),
);
$line = sprintf(
Expand Down

0 comments on commit b56d22f

Please sign in to comment.