From a74fa31831721b92676549038895295a031ffc13 Mon Sep 17 00:00:00 2001 From: Steven Robertson Date: Tue, 27 Jun 2023 20:38:40 +0100 Subject: [PATCH] Null handling on privacy policy and tos pages --- apps/web/src/redux/app/sagas.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/web/src/redux/app/sagas.js b/apps/web/src/redux/app/sagas.js index dbbfe93..0499fc8 100644 --- a/apps/web/src/redux/app/sagas.js +++ b/apps/web/src/redux/app/sagas.js @@ -88,8 +88,8 @@ function* handleRequestTermsOfUseActions(_) { const response = yield call(gqlFetch, userId, query, variables); console.assert(response?.data?.text, response); console.assert(response?.data?.text.length === 1, response); - console.assert(response?.data?.text[0].text, response); - yield put(receiveTermsOfUse(response.data.text[0].text)); + console.assert(response?.data?.text[0]?.text, response); + yield put(receiveTermsOfUse(response?.data?.text[0]?.text || '# Terms of Use\n\nTODO')); } catch (e) { handleException(e); } @@ -110,8 +110,8 @@ function* handleRequestPrivacyPolicyActions(_) { const response = yield call(gqlFetch, userId, query, variables); console.assert(response?.data?.text, response); console.assert(response?.data?.text.length === 1, response); - console.assert(response?.data?.text[0].text, response); - yield put(receivePrivacyPolicy(response.data.text[0].text)); + console.assert(response?.data?.text[0]?.text, response); + yield put(receivePrivacyPolicy(response?.data?.text[0]?.text || '# Privacy Policy\n\nTODO')); } catch (e) { handleException(e); }