mirror of
https://koodu.h-i.works/projects/thebadspace
synced 2025-05-06 14:41:02 -05:00
Null images hotfix
The archived build errors out when it finds the images json field is null, so this will replace a null value with an empty array instead. Should probalby just make images non null and an empty array the default
This commit is contained in:
parent
f9405aae33
commit
c91eed0e30
@ -79,11 +79,17 @@ class LocationController extends Controller
|
||||
++$duplicates;
|
||||
//update block count for existing item
|
||||
$location->block_count = $blockcount;
|
||||
|
||||
//replace null with empty array
|
||||
if ($location->images == null) {
|
||||
$location->images = [];
|
||||
};
|
||||
$location->save();
|
||||
} else {
|
||||
// make new entries for instances not present
|
||||
if ($item[0] != 'domain') {
|
||||
++$fresh;
|
||||
$images = [];
|
||||
$new = Location::create([
|
||||
'uuid' => Uuid::uuid4(),
|
||||
'name' => $item[0],
|
||||
@ -93,7 +99,8 @@ class LocationController extends Controller
|
||||
'rating' => $item[1],
|
||||
'added_by' => 1,
|
||||
'tags' => 'poor moderation, hate speech',
|
||||
'block_count' => $blockcount
|
||||
'block_count' => $blockcount,
|
||||
'images' => $images,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user