Skip to content

Commit

Permalink
Merge pull request #154 from AlexandreBeaurain/master
Browse files Browse the repository at this point in the history
fix: allow image upload without req.query.input
  • Loading branch information
gregorybesson committed Mar 15, 2017
2 parents 49901ac + 5404030 commit 46e4bbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cli/cms/media/image.js
Expand Up @@ -131,7 +131,7 @@ export function saveFile(req) {
var thumbPromise = generateThumbnail(filePath)
thumbPromise.then(function (thumbResp) {
resp.thumbnail = (/^win/.test(process.platform)) ? thumbResp.thumb.replace(/\\/g, '/') : thumbResp.thumb;
if(req.query.input.indexOf('data-size') > -1){
if(req && req.query && req.query.input && ( req.query.input.indexOf('data-size') > -1 )){
var thumbsSizes = cmsData.regex.getAttr(req.query.input, 'data-size').split(',')
cropAndSaveFiles(thumbsSizes, filePath, resp).then(function (resp) {
if(/^win/.test(process.platform)){
Expand Down

0 comments on commit 46e4bbf

Please sign in to comment.