From 9f11b2b7bc6a0c935b7c3337be81f64c4b4343c9 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Mon, 15 Jan 2024 09:17:50 +0100 Subject: [PATCH] Interfaces/ZUGFeRD: check if any extension exists --- Interfaces/ZUGFeRDInterface/PDFEmbeds.vb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Interfaces/ZUGFeRDInterface/PDFEmbeds.vb b/Interfaces/ZUGFeRDInterface/PDFEmbeds.vb index 169c5a11..95bb1ffd 100644 --- a/Interfaces/ZUGFeRDInterface/PDFEmbeds.vb +++ b/Interfaces/ZUGFeRDInterface/PDFEmbeds.vb @@ -165,7 +165,14 @@ Public Class PDFEmbeds If GDPicturePDF.GetStat() = GdPictureStatus.OK Then Logger.Debug("Extracting embedded file [{0}]", oFileName) - Dim oExtension = New FileInfo(oFileName).Extension.ToUpper.Substring(1) + Dim oFileInfo = New FileInfo(oFileName) + Dim oExtension As String = oFileInfo.Extension + + If String.IsNullOrWhiteSpace(oExtension) Then + Logger.Error("The embedded file [{0}] does not have any extension. Skipping.") + Continue For + End If + If pExtensions.Contains(oExtension) Then Dim oFileSize As Integer = GDPicturePDF.GetEmbeddedFileSize(oIndex)