From df022bd918369613516150547fed56844e209c39 Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Wed, 22 May 2024 08:49:56 +0100 Subject: [PATCH] Fix null value errors in attribute casting --- packages/core/src/Base/Casts/AsAttributeData.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/core/src/Base/Casts/AsAttributeData.php b/packages/core/src/Base/Casts/AsAttributeData.php index c903105f75..2a43693312 100644 --- a/packages/core/src/Base/Casts/AsAttributeData.php +++ b/packages/core/src/Base/Casts/AsAttributeData.php @@ -47,6 +47,10 @@ public function set($model, $key, $value, $attributes) $data = []; foreach ($value ?? [] as $handle => $item) { + if ($item === null) { + continue; + } + $data[$handle] = [ 'field_type' => get_class($item), 'value' => $item->getValue(),