From 022874aa539f18e9e7d716148cde532397f84ec7 Mon Sep 17 00:00:00 2001 From: langren1353 <14857127+langren1353@users.noreply.github.com> Date: Sun, 10 Oct 2021 22:21:01 +0800 Subject: [PATCH] Update utils.js fix when script run with TamperMonkey or GreaseMonkey tag is null --- packages/less/src/less-browser/utils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/less/src/less-browser/utils.js b/packages/less/src/less-browser/utils.js index 2a9915cc3..42a1b442e 100644 --- a/packages/less/src/less-browser/utils.js +++ b/packages/less/src/less-browser/utils.js @@ -9,6 +9,7 @@ export function extractId(href) { } export function addDataAttr(options, tag) { + if(!tag) return; // in case of tag is null or undefined for (const opt in tag.dataset) { if (tag.dataset.hasOwnProperty(opt)) { if (opt === 'env' || opt === 'dumpLineNumbers' || opt === 'rootpath' || opt === 'errorReporting') {