mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -08:00
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:
commit
8857391da7
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue