diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 07f3662..f9f96a0 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,16 +1,16 @@ - - - - tests/ - - - - - src/ - - tests/ - - - + + + + src/ + + + tests/ + + + + + tests/ + + diff --git a/src/DataFormatter/XMLDataFormatter.php b/src/DataFormatter/XMLDataFormatter.php index 63dfa46..f53731d 100644 --- a/src/DataFormatter/XMLDataFormatter.php +++ b/src/DataFormatter/XMLDataFormatter.php @@ -126,7 +126,7 @@ public function convertDataObjectWithoutHeader(DataObject $obj, $fields = null, continue; } $fieldValue = $obj->obj($fieldName)?->forTemplate(); - if (!mb_check_encoding($fieldValue, 'utf-8')) { + if (isset($fieldValue) && !mb_check_encoding($fieldValue, 'utf-8')) { $fieldValue = "(data is badly encoded)"; }