Skip to content

Commit ecf02f2

Browse files
committed
MQE-118: Handle XML merge failures gracefully
- Added check for false returns from loadXML
1 parent 428721a commit ecf02f2

File tree

1 file changed

+4
-1
lines changed
  • src/Magento/FunctionalTestingFramework/Config

1 file changed

+4
-1
lines changed

src/Magento/FunctionalTestingFramework/Config/Dom.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,10 @@ protected function initDom($xml, $filename = null)
364364
{
365365
$dom = new \DOMDocument();
366366
try {
367-
$dom->loadXML($xml);
367+
$domSuccess = $dom->loadXML($xml);
368+
if (!$domSuccess) {
369+
throw new \Exception();
370+
}
368371
} catch (\Exception $exception) {
369372
throw new ValidationException("XML Parse Error: $filename\n");
370373
}

0 commit comments

Comments
 (0)