From 4ded93d77b8878e54dc71c34070fdc7aa76b240f Mon Sep 17 00:00:00 2001
From: Jack Reed <phillipjreed@gmail.com>
Date: Tue, 24 Nov 2020 16:09:57 -0700
Subject: [PATCH] More safely navigate deep destructuring of config.auth

---
 src/state/sagas/auth.js     | 2 +-
 src/state/selectors/auth.js | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/state/sagas/auth.js b/src/state/sagas/auth.js
index 21135885e..0ecb94976 100644
--- a/src/state/sagas/auth.js
+++ b/src/state/sagas/auth.js
@@ -73,7 +73,7 @@ export function* refetchInfoResponses({ serviceId }) {
 /** try to start any non-interactive auth flows */
 export function* doAuthWorkflow({ infoJson, windowId }) {
   const auths = yield select(getAuth);
-  const { auth: { serviceProfiles } } = yield select(getConfig);
+  const { auth: { serviceProfiles = [] } = {} } = yield select(getConfig);
   const nonInteractiveAuthFlowProfiles = serviceProfiles.filter(p => p.external || p.kiosk);
 
   // try to get an untried, non-interactive auth service
diff --git a/src/state/selectors/auth.js b/src/state/selectors/auth.js
index 034502147..07ce12536 100644
--- a/src/state/selectors/auth.js
+++ b/src/state/selectors/auth.js
@@ -10,7 +10,7 @@ export const getAuthProfiles = createSelector(
   [
     getConfig,
   ],
-  ({ auth: { serviceProfiles = [] } }) => serviceProfiles,
+  ({ auth: { serviceProfiles = [] } = {} }) => serviceProfiles,
 );
 
 /** */
-- 
GitLab