From 2373717283ab848804e605380f3fb3374b0bfd78 Mon Sep 17 00:00:00 2001 From: dankito Date: Thu, 21 Nov 2024 21:49:58 +0100 Subject: [PATCH] Fixed that filename may is null --- .../src/main/kotlin/net/codinux/invoicing/mail/MailReader.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e-invoicing-domain/src/main/kotlin/net/codinux/invoicing/mail/MailReader.kt b/e-invoicing-domain/src/main/kotlin/net/codinux/invoicing/mail/MailReader.kt index f76acc7..c8f69e4 100644 --- a/e-invoicing-domain/src/main/kotlin/net/codinux/invoicing/mail/MailReader.kt +++ b/e-invoicing-domain/src/main/kotlin/net/codinux/invoicing/mail/MailReader.kt @@ -144,7 +144,7 @@ class MailReader( } private fun tryToReadEInvoice(part: Part, mediaType: String?): Invoice? = try { - val filename = part.fileName.lowercase() + val filename = part.fileName?.lowercase() ?: "" if (filename.endsWith(".pdf") || mediaType == "application/pdf" || mediaType == "application/octet-stream") { eInvoiceReader.extractFromPdf(part.inputStream)