Modules.Jobs: Prüfe ob Value überhaupt einen Wert hat, sonst wird auch keine Datei erstellt

This commit is contained in:
PitzM 2025-06-12 10:41:31 +02:00
parent 2673755b14
commit 267e038725

View File

@ -778,23 +778,26 @@ Public Class ImportZUGFeRDFiles
Dim oMimeTypeProperty As ValidProperty = GetIndexProperty(embAttachmentList, groupIndex, "ATTACHMENT_FILE_MIMECODE")
If oMimeTypeProperty IsNot Nothing AndAlso oMimeTypeProperty.Value IsNot Nothing Then
If oMimeTypeProperty IsNot Nothing AndAlso oMimeTypeProperty.Value.IsNotNullOrEmpty() Then
oMimeCodeString = oMimeTypeProperty.Value.ToLower()
Else
_logger.Info("Empty MIME-Code! File can not be stored!")
_logger.Debug("Empty MIME-Code! File can not be stored!")
Continue For
End If
Dim oFilenameProperty As ValidProperty = GetIndexProperty(embAttachmentList, groupIndex, "ATTACHMENT_FILE_FILENAME")
If oFilenameProperty IsNot Nothing Then
If oFilenameProperty IsNot Nothing AndAlso oFilenameProperty.Value.IsNotNullOrEmpty() Then
oOrgFilename = oFilenameProperty.Value
Else
_logger.Debug("Empty Filename! File can not be stored!")
Continue For
End If
Dim oBase64ValueProperty As ValidProperty = GetIndexProperty(embAttachmentList, groupIndex, "ATTACHMENT_FILE_VALUE")
If oBase64ValueProperty IsNot Nothing Then
If oBase64ValueProperty IsNot Nothing AndAlso oBase64ValueProperty.Value.IsNotNullOrEmpty() Then
oBase64String = oBase64ValueProperty.Value
Else
_logger.Warn("Empty base64 String")
_logger.Error("Empty base64 String! File can not be stored!")
Continue For
End If
@ -803,6 +806,9 @@ Public Class ImportZUGFeRDFiles
Dim oFileExtension = GetEmbeddedFileExtension(oMimeTypeProperty.Value)
If oFileExtension.IsNotNullOrEmpty() Then
newAttachmentFilename += "." + oFileExtension
Else
_logger.Warn("No extension found! File can not be stored!")
Continue For
End If
Dim embeddedFilePath = Path.Combine(oOutputPath, newAttachmentFilename)