From c549dc8615fce191cd7f34befffca79056d1d416 Mon Sep 17 00:00:00 2001 From: Adriano Serighelli Date: Thu, 5 Jun 2025 16:25:18 -0300 Subject: [PATCH] =?UTF-8?q?Corre=C3=A7=C3=A3o=20para=20a=20vari=C3=A1vel?= =?UTF-8?q?=20documentType=20somente=20ser=20verificada=20se=20ela=20exist?= =?UTF-8?q?ir.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Webhook 4docs/Program.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Webhook 4docs/Program.cs b/Webhook 4docs/Program.cs index 10a65fd..1a55476 100644 --- a/Webhook 4docs/Program.cs +++ b/Webhook 4docs/Program.cs @@ -118,7 +118,10 @@ namespace Webhook_4docs JsonElement DadosJson = JsonDocument.Parse(root.ToString()).RootElement; - if (root.Get("documentType")?.ToString().ToLower() != "nota_fiscal") { return; } + if (root.Get("documentType").ToString().ToLower() != string.Empty) + { + if (root.Get("documentType")?.ToString().ToLower() != "nota_fiscal") { return; } + } Fatura fatura = new(fatura_ID, JsonBody); bool completed = false;