From 267e038725a0bc497f9c94eb80300324e84f0e87 Mon Sep 17 00:00:00 2001 From: pitzm Date: Thu, 12 Jun 2025 10:41:31 +0200 Subject: [PATCH] =?UTF-8?q?Modules.Jobs:=20Pr=C3=BCfe=20ob=20Value=20?= =?UTF-8?q?=C3=BCberhaupt=20einen=20Wert=20hat,=20sonst=20wird=20auch=20ke?= =?UTF-8?q?ine=20Datei=20erstellt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb b/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb index 690d11ac..d52bb6bf 100644 --- a/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb +++ b/Jobs/ZUGFeRD/ImportZUGFeRDFiles.vb @@ -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)