Skip to content

Commit 7b133aa

Browse files
committed
fix: ensure node exists
1 parent 28e17f9 commit 7b133aa

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const plugin = (plugins = null, options = null, filterType = null) => {
1919
tree.walk(node => {
2020
let promise
2121

22-
if (node.tag === 'style' && node.content) {
22+
if (node?.tag === 'style' && node.content) {
2323
let meetsFilter = true
2424

2525
if (filterType) {
@@ -43,7 +43,7 @@ const plugin = (plugins = null, options = null, filterType = null) => {
4343
}
4444
}
4545

46-
if (node.attrs?.style) {
46+
if (node?.attrs?.style) {
4747
promise = css.process(node.attrs.style, options)
4848
.then(result => {
4949
node.attrs.style = result.css

package-lock.json

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)