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)