From 354f0820418cf12e2ed6dca535f84e27d2dddb21 Mon Sep 17 00:00:00 2001 From: Stefanie Gevaert <> Date: Thu, 2 Jun 2022 14:24:41 +0200 Subject: [PATCH] chore: provide a fallback when class isn't provided --- src/fields/ColourSwatches.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fields/ColourSwatches.php b/src/fields/ColourSwatches.php index 3576666..1add104 100644 --- a/src/fields/ColourSwatches.php +++ b/src/fields/ColourSwatches.php @@ -151,7 +151,7 @@ public function serializeValue(mixed $value, ?ElementInterface $element = null): if ($value && ($palette["label"] === $value['label'])) { $saveValue = $value; $saveValue['color'] = $palette['color']; - $saveValue['class'] = $palette['class']; + $saveValue['class'] = $palette['class'] ?? ''; } }