From 5909dd7a496307f69b6f8c31924337ac7fe3d1fd Mon Sep 17 00:00:00 2001 From: rosie <98649425+Asm-Rosie@users.noreply.github.com> Date: Sat, 2 Dec 2023 23:14:09 +0100 Subject: [PATCH] Update image.js adding try and catch block to lib/image.js --- lib/image.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/image.js b/lib/image.js index 4a37849ee..0fd67e99f 100644 --- a/lib/image.js +++ b/lib/image.js @@ -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 + } }