Skip to content

Commit

Permalink
fix undefined error when opts is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Alanscut committed Oct 12, 2020
1 parent f829dd2 commit db49e41
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 db49e41

Please sign in to comment.