From 77696ad6756b0504833d4c3abf1aa4c762ca9189 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Fri, 18 Oct 2024 15:25:50 +0100 Subject: [PATCH] [5.x] Fix error when editing Bard field with set and no fields (#10971) --- src/Fieldtypes/Sets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Fieldtypes/Sets.php b/src/Fieldtypes/Sets.php index e9163dc50d..b9666ba870 100644 --- a/src/Fieldtypes/Sets.php +++ b/src/Fieldtypes/Sets.php @@ -55,7 +55,7 @@ public function preProcess($sets) 'instructions' => $set['instructions'] ?? null, 'icon' => $set['icon'] ?? null, 'hide' => $set['hide'] ?? null, - 'fields' => collect($set['fields'])->map(function ($field, $i) use ($setId) { + 'fields' => collect($set['fields'] ?? [])->map(function ($field, $i) use ($setId) { return array_merge(FieldTransformer::toVue($field), ['_id' => $setId.'-'.$i]); })->all(), ];