Skip to content

Commit 09bb0c3

Browse files
committed
fix(authorizer): fix the null poinyter error when event is CustomAuthorizerEvent
1 parent 2864a59 commit 09bb0c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ export class UtilsSvc {
9696
): Promise<APIGatewayProxyResult> => {
9797
try {
9898
Sentry.configureScope(scope => {
99-
if (event.requestContext.authorizer) {
99+
// make sure we check the `requestContext` as it is optional field CustomAuthorizerEvent
100+
if (event.requestContext && event.requestContext.authorizer) {
100101
const {
101102
principalId: accountId,
102103
userId,

0 commit comments

Comments
 (0)