Skip to content

Commit

Permalink
Fix XmlConverterCiiToUbl::checkValidSource
Browse files Browse the repository at this point in the history
  • Loading branch information
HorstOeko committed Nov 12, 2024
1 parent 419425d commit accf3c8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/XmlConverterCiiToUbl.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ protected function getDestinationNamespaces(): array
protected function checkValidSource()
{
$invoiceElement = $this->source->query('//rsm:CrossIndustryInvoice')->item(0);

if (is_null($invoiceElement)) {
throw new \RuntimeException('The document is not a valid CII document');
}

$invoiceExchangeDocumentContext = $this->source->query('./rsm:ExchangedDocumentContext', $invoiceElement)->item(0);

if (is_null($invoiceExchangeDocumentContext)) {
Expand Down

0 comments on commit accf3c8

Please sign in to comment.