mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 21:31:36 +02:00
added null check to where we insert elements into a project
This commit is contained in:
@@ -71,6 +71,10 @@ sanitizeTypeOfElement = (elementType)->
|
||||
return elementType
|
||||
|
||||
ProjectSchema.statics.putElement = (project_id, folder_id, element, type, callback)->
|
||||
if !element?
|
||||
e = new Error("no element passed to be inserted")
|
||||
logger.err project_id:project_id, folder_id:folder_id, element:element, type:type, "failed trying to insert element as it was null"
|
||||
return callback(e)
|
||||
type = sanitizeTypeOfElement type
|
||||
this.findById project_id, (err, project)=>
|
||||
if err?
|
||||
|
||||
Reference in New Issue
Block a user