From 9c232df3be16f33ce53e479917ade02e2988d0bf Mon Sep 17 00:00:00 2001 From: Luiz Fernando Borges Vieira <90727358+vieirafb@users.noreply.github.com> Date: Tue, 9 Jul 2024 18:09:13 -0300 Subject: [PATCH] =?UTF-8?q?Fix:=20Erro=20na=20gera=C3=A7=C3=A3o=20do=20PDF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Desencadeava erro caso o XML não possuísse a tag infANTT. --- src/MDFe/Damdfe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MDFe/Damdfe.php b/src/MDFe/Damdfe.php index e9b52bbf..d2f02180 100644 --- a/src/MDFe/Damdfe.php +++ b/src/MDFe/Damdfe.php @@ -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; } }