From cc2e0018f087468c687bfdb93b5e65007afd0dab Mon Sep 17 00:00:00 2001 From: prashantbazaarvoice Date: Mon, 25 Mar 2024 10:14:57 +0530 Subject: [PATCH] fix for PD-234259 console error --- lib/loader/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/loader/index.js b/lib/loader/index.js index 4a9c3ea..7e3a81f 100644 --- a/lib/loader/index.js +++ b/lib/loader/index.js @@ -152,8 +152,9 @@ module.exports = { done = true; clearTimeout(timeoutHandle); script.onload = script.onreadystatechange = script.onerror = null; - script.parentNode.removeChild(script); - + if (script && script.parentNode) { + script.parentNode.removeChild(script); + } if (!err) { _loadedUrls[url] = true;