Procházet zdrojové kódy

Handle undefined rootDoc when restoring a file (#28118)

GitOrigin-RevId: f3aa32d2443f3fffbda8a10cc35d5dec3db71143
Domagoj Kriskovic před 11 měsíci
rodič
revize
e915003a61

+ 5 - 1
services/web/app/src/Features/History/RestoreManager.js

@@ -143,7 +143,11 @@ const RestoreManager = {
         userId
       )
 
-      if (file.element._id.toString() === project.rootDoc_id.toString()) {
+      if (
+        file.element._id &&
+        project.rootDoc_id &&
+        file.element._id.toString() === project.rootDoc_id.toString()
+      ) {
         hadDeletedRootFile = true
       }