Merge pull request #244 from Alanscut/opts-type
fix undefined error when opts is undefined
This commit is contained in:
commit
d35977317b
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue