fix: add null check when start running project the currentButton is null
This commit is contained in:
parent
c57919ea2a
commit
26a11776e4
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
modalImage.src = currentButton.children[0].src;
|
||||||
if (modalImage.style.display === 'none') {
|
if (modalImage.style.display === 'none') {
|
||||||
modal.style.setProperty('background-image', `url(${modalImage.src})`)
|
modal.style.setProperty('background-image', `url(${modalImage.src})`)
|
||||||
|
|
Loading…
Reference in a new issue