Jobs/zugferd: add fallback for missing values in GetEmailDataForMessageId
This commit is contained in:
parent
79cad24b3f
commit
902c835c37
@ -1,5 +1,6 @@
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Language
|
||||
Imports System.Data
|
||||
Imports System.IO
|
||||
Imports System.Data.SqlClient
|
||||
@ -164,10 +165,19 @@ Public Class EmailFunctions
|
||||
_logger.Debug("Got Email Data for FileId {0}", MessageId)
|
||||
oRow = oDatatable.Rows.Item(oDatatable.Rows.Count - 1)
|
||||
|
||||
Dim oFromDefault = String.Format("No Sender found for ({0})", MessageId)
|
||||
Dim oFrom = oRow.ItemEx("EMAIL_FROM", oFromDefault)
|
||||
|
||||
Dim oAttachmentDefault = String.Format("No Attachment found for ({0})", MessageId)
|
||||
Dim oAttachment = oRow.ItemEx("EMAIL_ATTMT1", oAttachmentDefault)
|
||||
|
||||
Dim oSubjectDefault = String.Format("No Subject found for ({0})", MessageId)
|
||||
Dim oSubject = oRow.ItemEx("EMAIL_SUBJECT", oSubjectDefault)
|
||||
|
||||
Return New EmailData() With {
|
||||
.From = oRow.Item("EMAIL_FROM"),
|
||||
.Attachment = oRow.Item("EMAIL_ATTMT1"),
|
||||
.Subject = oRow.Item("EMAIL_SUBJECT")
|
||||
.From = oFrom,
|
||||
.Attachment = oAttachment,
|
||||
.Subject = oSubject
|
||||
}
|
||||
Catch ex As Exception
|
||||
_logger.Warn("Could not fetch Email Data for FileId {0}", MessageId)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user