diff --git a/lib/node-progress.js b/lib/node-progress.js index 2b62641..b9de1cc 100644 --- a/lib/node-progress.js +++ b/lib/node-progress.js @@ -52,7 +52,10 @@ function ProgressBar(fmt, options) { } else { options = options || {}; if ('string' != typeof fmt) throw new Error('format required'); - if ('number' != typeof options.total) throw new Error('total required'); + if ( + 'number' != typeof options.total + || isNaN(options.total) + ) throw new Error('total of number format required'); } this.fmt = fmt;