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

throw Error
when Existing page does not have revisionId

kaori пре 4 година
родитељ
комит
a241e7f6a7
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      packages/app/src/components/Sidebar/PageTree/Item.tsx

+ 5 - 1
packages/app/src/components/Sidebar/PageTree/Item.tsx

@@ -236,7 +236,11 @@ const Item: FC<ItemProps> = (props: ItemProps) => {
 
     const { _id: pageId, revision: revisionId, path } = page;
 
-    if (pageId == null || revisionId == null || path == null) {
+    if (!page.isEmpty && revisionId == null) {
+      throw Error('Existing page should have revisionId');
+    }
+
+    if (pageId == null || path == null) {
       throw Error('Any of _id and revisionId and path must not be null.');
     }