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)