Skip to content

Commit 6e21688

Browse files
Adds a property check
1 parent 297f12b commit 6e21688

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rules/req-charset-utf/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
lint(node, rule_config, { report }) {
99
// eslint-disable-next-line camelcase
1010
if (dom_utils.is_tag_node(node) && node.name === 'meta') {
11-
const hasUtf = node.attributes.some((attribute) => attribute.value.chars.toLowerCase() === 'utf-8');
11+
const hasUtf = node.attributes.some((attribute) => attribute?.value?.chars.toLowerCase() === 'utf-8');
1212
const hasCharset = node.attributes.some((attribute) => attribute.name.chars === 'charset');
1313

1414
if (hasCharset === true && hasUtf === false) {

0 commit comments

Comments
 (0)