Common/DocumentResultList: Catch errors better

This commit is contained in:
Jonathan Jenne
2021-12-23 10:29:37 +01:00
parent 38608e353a
commit b1af861810
3 changed files with 28 additions and 16 deletions

View File

@@ -210,12 +210,6 @@ Public Class frmDocumentResultList
DocumentViewer1.CloseDocument()
oDocumentInfo = _documentloader.Load(oObjectId, oFullPath)
Dim oFileName = $"{oObjectId}.{oDocumentInfo.Extension}"
DocumentViewer1.LoadFile(oFileName, New MemoryStream(oDocumentInfo.Contents))
' Save reference to current
_CurrentDocument = oDocumentInfo
' Check DocumentInfo
If IsNothing(oDocumentInfo) Then
@@ -223,6 +217,13 @@ Public Class frmDocumentResultList
Exit Sub
End If
Dim oFileName = $"{oObjectId}.{oDocumentInfo.Extension}"
DocumentViewer1.LoadFile(oFileName, New MemoryStream(oDocumentInfo.Contents))
' Save reference to current
_CurrentDocument = oDocumentInfo
If oDocumentInfo.AccessRight = Rights.AccessRight.VIEW_ONLY Then
DocumentViewer1.SetViewOnly(True)
RibbonPageGroup_Export.Visible = False