diff --git a/lib/server.js b/lib/server.js index ab72b21c..619e398e 100644 --- a/lib/server.js +++ b/lib/server.js @@ -92,7 +92,8 @@ exports.toCanvas = require('./browser').toCanvas exports.toString = function toString (text, opts, cb) { const params = checkParams(text, opts, cb) - const renderer = getStringRendererFromType(params.opts.type) + const type = params.opts ? params.opts.type : undefined + const renderer = getStringRendererFromType(type) return render(renderer.render, text, params) }