We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fe8cb8a commit 91db6d4Copy full SHA for 91db6d4
1 file changed
src/Dashboard/Dashboard.php
@@ -96,6 +96,10 @@ public function getAllWidgets(): Collection
96
$widgets = $this->getUserWidgets();
97
}
98
99
+ if ($widgets === false) {
100
+ return collect();
101
+ }
102
+
103
return $widgets;
104
105
@@ -107,7 +111,13 @@ public function getAllWidgets(): Collection
107
111
*/
108
112
public function doesUserHaveWidget(string $type): bool
109
113
{
110
- return $this->getUserWidgets()->contains(fn (WidgetInterface $widget) => $widget::class === $type);
114
+ $widgets = $this->getUserWidgets();
115
116
117
+ return false;
118
119
120
+ return $widgets->contains(fn (WidgetInterface $widget) => $widget::class === $type);
121
122
123
/**
0 commit comments