Skip to content

Commit

Permalink
Merge pull request #244 from Alanscut/opts-type
Browse files Browse the repository at this point in the history
fix undefined error when opts is undefined
  • Loading branch information
soldair authored Oct 28, 2020
2 parents f829dd2 + db49e41 commit d359773
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit d359773

Please sign in to comment.