فهرست منبع

Handle undefined rootDoc when restoring a file (#28118)

GitOrigin-RevId: f3aa32d2443f3fffbda8a10cc35d5dec3db71143
Domagoj Kriskovic 1 سال پیش
والد
کامیت
e915003a61
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      services/web/app/src/Features/History/RestoreManager.js

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

@@ -143,7 +143,11 @@ const RestoreManager = {
         userId
         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
         hadDeletedRootFile = true
       }
       }