From 3d2f3fe50149305a8e456d44062a21a5600eaa89 Mon Sep 17 00:00:00 2001 From: shur Date: Tue, 20 Aug 2024 09:49:24 -0400 Subject: [PATCH] optional chaining on err response object Co-authored-by: Rico Kahler --- .../sanity/src/core/studio/screens/RequestAccessScreen.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/sanity/src/core/studio/screens/RequestAccessScreen.tsx b/packages/sanity/src/core/studio/screens/RequestAccessScreen.tsx index eceffb596ea..fd1db0fc60f 100644 --- a/packages/sanity/src/core/studio/screens/RequestAccessScreen.tsx +++ b/packages/sanity/src/core/studio/screens/RequestAccessScreen.tsx @@ -133,8 +133,8 @@ export function RequestAccessScreen() { if (request) setHasPendingRequest(true) }) .catch((err) => { - const statusCode = err && err.response && err.response.statusCode - const errMessage = err && err.response && err.response.body && err.response.body.message + const statusCode = err?.response?.statusCode + const errMessage = err?.response?.body?.message if (statusCode === 429) { // User is over their cross-project request limit setHasTooManyRequests(true)