Skip to content

Commit

Permalink
Update utils.js (#3656)
Browse files Browse the repository at this point in the history
fix when script run with TamperMonkey or GreaseMonkey tag is null
  • Loading branch information
langren1353 committed Nov 11, 2021
1 parent 8666b01 commit f613188
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/less/src/less-browser/utils.js
Expand Up @@ -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') {
Expand Down

0 comments on commit f613188

Please sign in to comment.