Răsfoiți Sursa

Merge branch 'support/apply-nextjs-2' into support/apply-nextjs-to-PageComments

jam411 3 ani în urmă
părinte
comite
d78175cb17
1 a modificat fișierele cu 3 adăugiri și 0 ștergeri
  1. 3 0
      packages/app/src/pages/utils/objectid-transformer.ts

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