@measurequick/measurequick-report-generator 1.2.82 → 1.2.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measurequick/measurequick-report-generator",
3
- "version": "1.2.82",
3
+ "version": "1.2.83",
4
4
  "description": "Generates PDF documents for various MeasureQuick applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -63,7 +63,8 @@ export async function getReport(payload) { console.log("Photo Page(s) - Payload
63
63
  }
64
64
 
65
65
  photoSectionKeys = Object.keys(payload.photos.equipment);
66
- if (photoSectionKeys && photoSectionKeys.length > 0) {
66
+ let hasPhotos = payload.photos.equipment && payload.photos.equipment.photo_models_serials && payload.photos.equipment.photo_models_serials.photos && payload.photos.equipment.photo_models_serials.photos.length > 0;
67
+ if (photoSectionKeys && photoSectionKeys.length > 0 && hasPhotos) {
67
68
  docs[docIndex] = await PDFDocument.load(util._base64ToArrayBuffer(page.base64));
68
69
  forms[docIndex] = docs[docIndex].getForm();
69
70
  forms[docIndex].getButton("FullWidthLogo").setImage(await docs[docIndex].embedPng(mqLogoBytes));