Permalink
Browse files

Avoid null nodes (#33)

  • Loading branch information...
1 parent 6930714 commit 749b2928aa59b4cb5b01be8ba9aea3941aa2166b @unindented unindented committed Mar 8, 2013
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/instrumenter.js
View
10 lib/instrumenter.js
@@ -178,10 +178,12 @@
for (j = 0; j < childNode.length; j += 1) {
childElement = childNode[j];
pathElement.index = j;
- assignNode = walker.walk(childElement, null, pathElement) || childElement;
- if (isArray(assignNode.prepend)) {
- pushAll(childArray, assignNode.prepend);
- delete assignNode.prepend;
+ if (childElement) {
+ assignNode = walker.walk(childElement, null, pathElement) || childElement;
+ if (isArray(assignNode.prepend)) {
+ pushAll(childArray, assignNode.prepend);
+ delete assignNode.prepend;
+ }
}
pushAll(childArray, assignNode);
}

0 comments on commit 749b292

Please sign in to comment.