Skip to content

Commit

Permalink
Prevent parentNode call on null when modal element is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
crabbly committed Sep 9, 2020
1 parent 7bd95e3 commit ab4e31f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/js/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ const Modal = {
})
},
close () {
const printFrame = document.getElementById('printJS-Modal')
const printModal = document.getElementById('printJS-Modal')

printFrame.parentNode.removeChild(printFrame)
if (printModal) {
printModal.parentNode.removeChild(printModal)
}
}
}

Expand Down

0 comments on commit ab4e31f

Please sign in to comment.