Skip to content

Commit 90c288e

Browse files
committed
return null on null
1 parent ce6c57f commit 90c288e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/FieldModifier.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,16 @@ public static function sortJsonKeys($attribute)
2525

2626
public static function convertValue($value)
2727
{
28+
if (is_null($value)) {
29+
return null;
30+
}
31+
2832
if ($value instanceof \UnitEnum) {
2933
$value = $value->value;
3034
}
3135

3236
$jsonData = json_decode($value);
37+
3338
if (is_array($jsonData) || is_object($jsonData)) {
3439
return json_encode((array) $jsonData);
3540
}

0 commit comments

Comments
 (0)