Skip to content

Commit

Permalink
Handle nonexistent children
Browse files Browse the repository at this point in the history
  • Loading branch information
jbhannah committed Oct 25, 2015
1 parent d164e38 commit 21a2064
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/amperize.js
Expand Up @@ -105,7 +105,7 @@ Amperize.prototype.traverse = function traverse(data, html, done) {
children = element.children;
html += helpers[element.type](element);

if (!children.length) return close(null, html);
if (!children || !children.length) return close(null, html);

setImmediate(function delay() {
traverse.call(amperize, children, html, close);
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "amperize",
"version": "0.1.4",
"version": "0.1.5",
"description": "AMP up your plain HTML",
"main": "./lib/amperize",
"scripts": {
Expand Down

0 comments on commit 21a2064

Please sign in to comment.