Przeglądaj źródła

throw Error
when Existing page does not have revisionId

kaori 4 lat temu
rodzic
commit
a241e7f6a7

+ 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.');
     }