diff --git a/src/components/uiKit/search/GlobalSearch/utils.tsx b/src/components/uiKit/search/GlobalSearch/utils.tsx index 53f016ae3..614ebc671 100644 --- a/src/components/uiKit/search/GlobalSearch/utils.tsx +++ b/src/components/uiKit/search/GlobalSearch/utils.tsx @@ -1,7 +1,7 @@ import { isEmpty } from 'lodash'; export const highlightSearchMatch = (value: string, matchRegex: RegExp, search: string) => { - const result = !isEmpty(search) && value.search(matchRegex) >= 0; + const result = !isEmpty(search) && !isEmpty(value) && value.search(matchRegex) >= 0; return result ? ( { const interval = setInterval(async () => { - if (authWindow.closed) { + if (authWindow?.closed) { const { data } = await FenceApi.isAuthenticated(fence); if (data?.authenticated) { diff --git a/src/store/passport/thunks.ts b/src/store/passport/thunks.ts index 0d87ed92a..a67c69c4c 100644 --- a/src/store/passport/thunks.ts +++ b/src/store/passport/thunks.ts @@ -98,7 +98,7 @@ export const connectCavaticaPassport = createAsyncThunk< return new Promise((resolve, reject) => { const interval = setInterval(async () => { - if (authWindow.closed) { + if (authWindow?.closed) { await thunkAPI.dispatch(fetchCavaticaAuthentificationStatus()); const { passport: {