Skip to content

Commit 666b586

Browse files
author
Security Theater
authored
Config is set to an empty array by default
1 parent 21f7ffd commit 666b586

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Providers/JarvisServiceProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,19 +163,19 @@ private function registerBlades()
163163

164164
public function __get($key)
165165
{
166-
if (count(config('jarvis.models.user'))) {
166+
if (count(config('jarvis.models.user') ?? [])) {
167167
foreach (config('jarvis.models.user') as $key => $value) {
168168
$this->models[$key] = $value;
169169
}
170170
}
171-
foreach (config('jarvis.models.package') as $key => $value) {
171+
foreach (config('jarvis.models.package') ?? [] as $key => $value) {
172172
if (model_exists($key)) {
173173
$this->models[$key] = config('jarvis.models.namespace').ucfirst($key);
174174
} else {
175175
$this->models[$key] = $value;
176176
}
177177
}
178178

179-
return $this->models ?? null;
179+
return $this->models ?? [];
180180
}
181181
}

0 commit comments

Comments
 (0)