Skip to content

Commit 1469dfc

Browse files
Ignored null values in element position
1 parent c9b1e27 commit 1469dfc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ function element(ast, children, config) {
155155

156156
if (name === 'template' && 'content' in ast) {
157157
pos = ast.sourceCodeLocation
158-
start = pos && pos.startTag && position(pos.startTag).end
159-
end = pos && pos.endTag && position(pos.endTag).start
158+
start = pos && pos.startTag && position(pos.startTag)
159+
end = pos && pos.endTag && position(pos.endTag)
160160

161161
node.content = transform(ast.content, config)
162162

163-
if ((start || end) && config.file) {
163+
if (((start && start.end) || (end && end.start)) && config.file) {
164164
node.content.position = {start: start, end: end}
165165
}
166166
}

0 commit comments

Comments
 (0)