Fix: "Attempt to read property \"news\" on null" error
This commit is contained in:
@@ -21,7 +21,7 @@ class Controller extends BaseController
|
||||
{
|
||||
$data = json_decode(Storage::disk('local')->get($file));
|
||||
foreach ($path as $subobject) {
|
||||
$data = $data->$subobject;
|
||||
$data = $data->$subobject ?? [];
|
||||
}
|
||||
$items = [];
|
||||
foreach ($data as $item_data) {
|
||||
|
||||
Reference in New Issue
Block a user