Skip to content

Commit d2a8946

Browse files
committed
Fix owner condition assuming .creator is an object
1 parent fdd5182 commit d2a8946

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/authorization/policies/conditions/owner.condition.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ class OwnerCondition<
2929
return (object as MaybeSecured<User>).id;
3030
}
3131
const o = object as MaybeSecured<HasCreator>;
32-
return isIdLike(o.creator) ? o.creator : o.creator.value;
32+
return !o.creator
33+
? undefined
34+
: isIdLike(o.creator)
35+
? o.creator
36+
: o.creator.value;
3337
})();
3438
if (!creator) {
3539
Logger.warn(

0 commit comments

Comments
 (0)