Fixed that filename may is null
This commit is contained in:
parent
a2d34e217f
commit
2373717283
|
@ -144,7 +144,7 @@ class MailReader(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun tryToReadEInvoice(part: Part, mediaType: String?): Invoice? = try {
|
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") {
|
if (filename.endsWith(".pdf") || mediaType == "application/pdf" || mediaType == "application/octet-stream") {
|
||||||
eInvoiceReader.extractFromPdf(part.inputStream)
|
eInvoiceReader.extractFromPdf(part.inputStream)
|
||||||
|
|
Loading…
Reference in New Issue