B2018-071 Don't crash when trying to convert an invalid word document to PDF
This commit is contained in:
@@ -727,6 +727,8 @@ namespace VEPROMS.CSLA.Library
|
||||
PdfInfo myPdf = PdfInfo.Get(sect,DocReplace!=null);
|
||||
return true;
|
||||
}
|
||||
// B2018-071 Save list of DocIDs for invalid document so that error log messages are not repeated
|
||||
private static List<int> _MissingDocs = new List<int>();
|
||||
public static bool SetDocPdf(DocumentInfo docInfo, ItemInfo sect)
|
||||
{
|
||||
string pdfTmp = null;
|
||||
@@ -737,6 +739,11 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (!_MissingDocs.Contains(docInfo.DocID))// B2018-071 Only add the message once to the error log
|
||||
{
|
||||
_MyLog.WarnFormat("Error trying to create PDF DocID = {0}", docInfo.DocID);// 2018-071 MS Word section could not be converted to PDF
|
||||
_MissingDocs.Add(docInfo.DocID);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (pdfTmp == null) return false;
|
||||
|
Reference in New Issue
Block a user