broken a err and null check into 2 lines

This commit is contained in:
Henry Oswald 2015-02-19 10:54:28 +00:00
parent 67f4929e49
commit 4eed88c1ab

View file

@ -92,7 +92,10 @@ module.exports =
Project.getProject project_or_id, "", (err, project)-> Project.getProject project_or_id, "", (err, project)->
if err? or !project? if err?
logger.err err:err, project_or_id:project_or_id, "error getting project for finding element"
return callback(err)
if !project?
return callback("project could not be found for finding a element #{project_or_id}") return callback("project could not be found for finding a element #{project_or_id}")
if needlePath == '' || needlePath == '/' if needlePath == '' || needlePath == '/'
return callback(null, project.rootFolder[0]) return callback(null, project.rootFolder[0])