Interfaces/zugferd: fix parameter error which leads to falsely allowing mails with two zugferd invoices

This commit is contained in:
Jonathan Jenne 2022-12-21 10:16:50 +01:00
parent a9567a9d18
commit 79cad24b3f

View File

@ -220,7 +220,7 @@ Public Class ZUGFeRDInterface
Try
Dim oNavigator As XPathNavigator = pDocument.Item2.CreateNavigator()
Dim oReader As XmlReader
Dim oResult = Nothing
Dim oObject As Object = Nothing
Dim oAllowedTypes As New List(Of Type)
@ -242,7 +242,7 @@ Public Class ZUGFeRDInterface
Try
oReader = oNavigator.ReadSubtree()
oResult = oSerializer.Deserialize(oReader)
oObject = oSerializer.Deserialize(oReader)
_logger.Debug("Serializing with type [{0}] succeeded", oType.FullName)
Exit For
Catch ex As Exception
@ -252,11 +252,11 @@ Public Class ZUGFeRDInterface
End Try
Next
If oResult Is Nothing Then
If oObject Is Nothing Then
Throw New ApplicationException("No Types matched the given document. Document could not be serialized.")
End If
Return oResult
Return New Tuple(Of String, Object)(pDocument.Item1, oObject)
Catch ex As Exception
_logger.Error(ex)