B2020-133 When printing an EOP with the PDF Links option needed to add a check for a null reference when trying to add a link to an enhanced document step that does not exist.

This commit is contained in:
John Jenko 2020-10-14 13:36:35 +00:00
parent 683ff2d304
commit 314f695990

View File

@ -1127,6 +1127,8 @@ namespace Volian.Print.Library
private static void AddLinkToEnhancedDocument(PdfContentByte cb, float yLocation, int itemID, String token, int xLocation) private static void AddLinkToEnhancedDocument(PdfContentByte cb, float yLocation, int itemID, String token, int xLocation)
{ {
ItemInfo ii = ItemInfo.Get(itemID); ItemInfo ii = ItemInfo.Get(itemID);
//B2020-133 if "ii" is null, then the itemid was not found- probable enhanced step was deleted. so just return with out creating a link
if (ii == null) return;
string prefix = ii.MyDocVersion.DocVersionConfig.Print_PDFFilePrefix ?? ""; string prefix = ii.MyDocVersion.DocVersionConfig.Print_PDFFilePrefix ?? "";
string suffix = ii.MyDocVersion.DocVersionConfig.Print_PDFFileSuffix ?? ""; string suffix = ii.MyDocVersion.DocVersionConfig.Print_PDFFileSuffix ?? "";
ColumnText ct = new ColumnText(cb); ColumnText ct = new ColumnText(cb);