Przeglądaj źródła

Merge branch 'support/apply-nextjs-2' into imprv/101156-delete-unused-code-related-to-theme-preview-and-CustomBarEditor

kaori 3 lat temu
rodzic
commit
d9c93567d4

+ 3 - 0
packages/app/src/pages/utils/objectid-transformer.ts

@@ -6,6 +6,9 @@ export const registerTransformerForObjectId = (): void => {
   superjson.registerCustom<ObjectId|string, string>(
   superjson.registerCustom<ObjectId|string, string>(
     {
     {
       isApplicable: (v): v is ObjectId => {
       isApplicable: (v): v is ObjectId => {
+        if (v == null) {
+          return false;
+        }
         if (typeof v === 'string') {
         if (typeof v === 'string') {
           return ObjectId.isValid(v);
           return ObjectId.isValid(v);
         }
         }