Explorar o código

throw Error
when Existing page does not have revisionId

kaori %!s(int64=4) %!d(string=hai) anos
pai
achega
a241e7f6a7
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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.');
     }