Skip to content

Commit

Permalink
Update image.js
Browse files Browse the repository at this point in the history
adding try and catch block to lib/image.js
  • Loading branch information
klover-rs authored Dec 2, 2023
1 parent ad793da commit 5909dd7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ function getSource (img) {
}

function setSource (img, src, origSrc) {
SetSource.call(img, src)
img._originalSource = origSrc
try {
SetSource.call(img, src)
img._originalSource = origSrc
} catch (err) {
img._originalSource = null
throw err
}
}

0 comments on commit 5909dd7

Please sign in to comment.