Przeglądaj źródła

fix isApplicable

Yuki Takei 3 lat temu
rodzic
commit
c91681aa26

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

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