skip if no lastThreeImg is found

This commit is contained in:
simon 2021-03-19 13:04:01 +07:00
parent 74972282af
commit a2f88a795c
1 changed files with 6 additions and 2 deletions

View File

@ -74,8 +74,12 @@ function refreshImg() {
var newLink = "/dyn/current.png?t=" + timestamp;
var lastThreeImg = document.getElementById('last3-img');
var lastThreeA = document.getElementById('last3-a');
lastThreeImg.src = newLink;
lastThreeA.href = newLink;
try {
lastThreeImg.src = newLink;
lastThreeA.href = newLink;
} catch(e) {
// console.log('no link to change');
}
}
// wrap for interval