diff --git a/init.js b/init.js index fd27011..3ce901b 100644 --- a/init.js +++ b/init.js @@ -25,6 +25,10 @@ module.exports = function init (modules) { } return function renderToString (vnode) { + if (typeof vnode === 'undefined' || vnode === null) { + return '' + } + if (!vnode.sel && vnode.text) { return vnode.text } diff --git a/test/index.js b/test/index.js index d6f04b7..316bbd4 100644 --- a/test/index.js +++ b/test/index.js @@ -37,6 +37,12 @@ test('No modules', function (t) { ]) t.equal(renderToString(vnode), '
Paragraph 1