diff --git a/src/DataFormatter/XMLDataFormatter.php b/src/DataFormatter/XMLDataFormatter.php index c4ba879..56689d9 100644 --- a/src/DataFormatter/XMLDataFormatter.php +++ b/src/DataFormatter/XMLDataFormatter.php @@ -126,7 +126,7 @@ class XMLDataFormatter extends DataFormatter 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)"; }