Fixed issue which was causing issue to generating the PDF for the Work 365 invoices.

Object reference error on generate PDF