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
This commit is contained in:
snipe 2022-06-13 23:51:51 -07:00 committed by GitHub
commit 8857391da7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -117,9 +117,10 @@ class AssetsTransformer
} else {
$value = $asset->{$field->convertUnicodeDbSlug()};
if ($field->format == 'DATE'){
if ($field->format == 'DATE' && !is_null($value)){
$value = Helper::getFormattedDateObject($value)['formatted'];
}
$fields_array[$field->name] = [
'field' => e($field->convertUnicodeDbSlug()),
'value' => e($value),