Skip to content

Commit 8857391

Browse files
authored
Merge pull request #11305 from inietov/fixes/trying_to_access_array_offset_on_value_of_type_null
Fixed #11304 Trying to access array offset on value of type null at .../Transformers/AssetsTransformer.php
2 parents 3e8837d + 50c008e commit 8857391

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/Http/Transformers/AssetsTransformer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,10 @@ public function transformAsset(Asset $asset)
117117
} else {
118118
$value = $asset->{$field->convertUnicodeDbSlug()};
119119

120-
if ($field->format == 'DATE'){
120+
if ($field->format == 'DATE' && !is_null($value)){
121121
$value = Helper::getFormattedDateObject($value)['formatted'];
122122
}
123+
123124
$fields_array[$field->name] = [
124125
'field' => e($field->convertUnicodeDbSlug()),
125126
'value' => e($value),

0 commit comments

Comments
 (0)