Skip to content

Commit 91db6d4

Browse files
committed
Fix tests
1 parent fe8cb8a commit 91db6d4

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/Dashboard/Dashboard.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ public function getAllWidgets(): Collection
9696
$widgets = $this->getUserWidgets();
9797
}
9898

99+
if ($widgets === false) {
100+
return collect();
101+
}
102+
99103
return $widgets;
100104
}
101105

@@ -107,7 +111,13 @@ public function getAllWidgets(): Collection
107111
*/
108112
public function doesUserHaveWidget(string $type): bool
109113
{
110-
return $this->getUserWidgets()->contains(fn (WidgetInterface $widget) => $widget::class === $type);
114+
$widgets = $this->getUserWidgets();
115+
116+
if ($widgets === false) {
117+
return false;
118+
}
119+
120+
return $widgets->contains(fn (WidgetInterface $widget) => $widget::class === $type);
111121
}
112122

113123
/**

0 commit comments

Comments
 (0)