Skip to content

Commit

Permalink
fix: add null check when start running project the currentButton is null
Browse files Browse the repository at this point in the history
  • Loading branch information
dvsilch authored and AUTOMATIC1111 committed Oct 16, 2022
1 parent c57919e commit 26a1177
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion javascript/imageviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function updateOnBackgroundChange() {
}
})

if (modalImage.src != currentButton.children[0].src) {
if (currentButton?.children?.length > 0 && modalImage.src != currentButton.children[0].src) {
modalImage.src = currentButton.children[0].src;
if (modalImage.style.display === 'none') {
modal.style.setProperty('background-image', `url(${modalImage.src})`)
Expand Down

0 comments on commit 26a1177

Please sign in to comment.