mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-28 14:11:18 +00:00
Fix "cannot set headers after sent" in setting doc end point
If somehow a project ends up with the same doc/file in two locations in the file tree, then projectLocator.findElement will return the callback for both entries. This then tries to end the request multiple times. Of course this should never be a state the project is in, but if it is we should catch it.
This commit is contained in:
parent
835b43cab2
commit
b978171e0c
1 changed files with 5 additions and 1 deletions
|
@ -5,7 +5,11 @@ logger = require('logger-sharelatex')
|
|||
async = require('async')
|
||||
|
||||
module.exports =
|
||||
findElement: (options, callback = (err, element, path, parentFolder)->)->
|
||||
findElement: (options, _callback = (err, element, path, parentFolder)->)->
|
||||
callback = (args...) ->
|
||||
_callback(args...)
|
||||
_callback = () ->
|
||||
|
||||
{project, project_id, element_id, type} = options
|
||||
elementType = sanitizeTypeOfElement type
|
||||
|
||||
|
|
Loading…
Reference in a new issue