Skip to content

Commit

Permalink
Fix: Erro na geração do PDF
Browse files Browse the repository at this point in the history
Desencadeava erro caso o XML não possuísse a tag infANTT.
  • Loading branch information
vieirafb authored Jul 9, 2024
1 parent c5de6f8 commit 9c232df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/MDFe/Damdfe.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private function loadDoc($xml)
if (!empty($this->rodo)) {
$this->RNTRC = "";
$infANTT = $this->rodo->getElementsByTagName("infANTT")->item(0);
if (isset($infANTT->getElementsByTagName("RNTRC")->item(0)->nodeValue)) {
if (!empty($infANTT) && isset($infANTT->getElementsByTagName("RNTRC")->item(0)->nodeValue)) {
$this->RNTRC = $infANTT->getElementsByTagName("RNTRC")->item(0)->nodeValue;
}
}
Expand Down

0 comments on commit 9c232df

Please sign in to comment.