Fix: "Attempt to read property \"news\" on null" error
This commit is contained in:
1 parent
94eddea78b
commit
68ae6f9161
1 file changed
+1
-1
@@ -146,7 +146,7 @@ class NewsController extends Controller
|
||||
}
|
||||
$apiResult = $this->API('nieuws/' . $url . '?pagina=' . (int)max(1, $page) . ($total ? '&aantal=' . $total : ''));
|
||||
$news = [];
|
||||
foreach ($apiResult->news as $newsItem) {
|
||||
foreach ($apiResult->news ?? [] as $newsItem) {
|
||||
$news[] = new \Model\NewsItem($newsItem);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user