arvindr21 / blueimp-file-upload-expressjs

A simple express module for integrating jQuery File Upload.
http://expressjs-fileupload.cloudno.de/
104 stars 69 forks source link

fix initializing without imageVersions set #27

Closed linkesch closed 9 years ago

linkesch commented 9 years ago

Demo says, that minimal options are these:

var options = {
    tmpDir:  __dirname + '/../public/uploaded/tmp',
    uploadDir: __dirname + '/../public/uploaded/files',
    uploadUrl:  '/uploaded/files/',
    storage : {
        type : 'local'
    }
};

But when you initialize the module without imageVersions an error occurs:

.../blueimp-file-upload-expressjs/index.js:50
    Object.keys(opts.imageVersions).forEach(function(version) {
           ^
TypeError: Object.keys called on non-object

This simple PR fixes this issue with checking for opts.imageVersions before working with it.

arvindr21 commented 9 years ago

Thanks @orthes for the contribution

arvindr21 commented 9 years ago

+blueimp-file-upload-expressjs@0.3.2