Преглед изворни кода

Merge pull request #2329 from overleaf/bg-fix-exception-in-exports-handler

avoid exception when rootDoc is null

GitOrigin-RevId: caf37a78ef35285cf638322f943696aeceb10da6
Brian Gough пре 7 година
родитељ
комит
45cdb94f8a
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      services/web/app/src/Features/Exports/ExportsHandler.js

+ 1 - 1
services/web/app/src/Features/Exports/ExportsHandler.js

@@ -111,7 +111,7 @@ module.exports = ExportsHandler = self = {
       }
 
       const { project, rootDoc, user, historyVersion } = results
-      if (rootDoc[1] == null) {
+      if (!rootDoc || rootDoc[1] == null) {
         err = new Error('cannot export project without root doc')
         logger.warn({ err, project_id })
         return callback(err)