check if node exists before inheriting comments to it
This commit is contained in:
@@ -48,7 +48,7 @@ function traverse(parent, opts, scope) {
|
||||
// inherit comments from original node to the first replacement node
|
||||
var inheritTo = result;
|
||||
if (isArray) inheritTo = result[0];
|
||||
t.inheritsComments(inheritTo, node);
|
||||
if (inheritTo) t.inheritsComments(inheritTo, node);
|
||||
|
||||
// replace the node
|
||||
node = obj[key] = result;
|
||||
|
||||
Reference in New Issue
Block a user