Skip to content

Commit 296ed34

Browse files
committed
fix nullable site
1 parent 7345972 commit 296ed34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Routing/DataObjectRoute.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ public function getSite(): ?Site
9090
}
9191

9292
/**
93-
* @param Site $site
93+
* @param Site|null $site
9494
*
9595
* @return $this
9696
*/
97-
public function setSite(Site $site): self
97+
public function setSite(?Site $site): self
9898
{
9999
$this->site = $site;
100100

@@ -115,7 +115,7 @@ public function getContent(): ?object
115115
public function getRouteKey(): ?string
116116
{
117117
if ($this->object) {
118-
return sprintf('data_object_%d_%d_%s', $this->object->getId(), $this->site->getId(), $this->getPath());
118+
return sprintf('data_object_%d_%d_%s', $this->object->getId(), $this->site?->getId(), $this->getPath());
119119
}
120120

121121
return null;

0 commit comments

Comments
 (0)