Skip to content

Commit e9cda5d

Browse files
[BUGFIX] Add null check for data node in MiscellaneousUtility (#2283)
Prevents an error with empty flexform like this one: ``` <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <T3FlexForms> </T3FlexForms> ``` * Invert condition parts --------- Co-authored-by: Claus Due <claus@namelesscoder.net>
1 parent 86c7a8e commit e9cda5d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎Classes/Utility/MiscellaneousUtility.php‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ public static function cleanFlexFormXml(string $xml, array $removals = []): stri
191191
$dataNodes = $dom->getElementsByTagName('data');
192192
/** @var DOMElement $dataNode */
193193
$dataNode = $dataNodes->item(0);
194+
if ($dataNode === null) {
195+
return '';
196+
}
194197
$elements = $dataNode->getElementsByTagName('sheet');
195198
if (0 === $elements->length) {
196199
return '';

0 commit comments

Comments
 (0)