Skip to content

Commit

Permalink
fix: Fix JS - null pointer errors and absent parameter with later dec…
Browse files Browse the repository at this point in the history
…omposing (#273)

Fixes #271
  • Loading branch information
yurtsevich-sbb authored Oct 23, 2024
1 parent 4397aff commit 61a1d3e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main/resources/webapp/pdf-exporter/js/pdf-exporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const PdfExporter = {
},

openPopup: function (params) {
this.exportContext = params?.exportContext ? params.exportContext : new ExportContext();
this.exportContext = params?.exportContext ? params.exportContext : new ExportContext({});

this.hideAlerts();
this.loadFormData();
Expand Down Expand Up @@ -606,8 +606,12 @@ const PdfExporter = {
document.querySelectorAll(".modal__container.pdf-exporter input.error").forEach(input => {
input.classList.remove("error");
});
document.getElementById('page-previews').innerHTML = "";
document.getElementById("suspicious-wi").innerHTML = "";
if (document.getElementById('page-previews')) {
document.getElementById('page-previews').innerHTML = "";
}
if (document.getElementById("suspicious-wi")) {
document.getElementById("suspicious-wi").innerHTML = "";
}
},

callAsync: function ({method, url, contentType, responseType, body}) {
Expand All @@ -629,4 +633,4 @@ const PdfExporter = {
},
}

PdfExporter.init();
PdfExporter.init();

0 comments on commit 61a1d3e

Please sign in to comment.