diff --git a/App.tsx b/App.tsx index b4d19691..181695fc 100644 --- a/App.tsx +++ b/App.tsx @@ -43,9 +43,12 @@ const App: React.FC = () => { }, []) const onBeforeLift = useCallback(async () => { - const netInfoRes = await netInfo() + let netInfoRes = undefined + try { + netInfoRes = await netInfo() + } catch {} - if (netInfoRes.corrupted && netInfoRes.corrupted.length) { + if (netInfoRes && netInfoRes.corrupted && netInfoRes.corrupted.length) { setLocalCorrupt(netInfoRes.corrupted) } diff --git a/__tests__/components/Button.js b/__tests__/components/Button.js index 063ebf06..9a2e0b8c 100644 --- a/__tests__/components/Button.js +++ b/__tests__/components/Button.js @@ -30,7 +30,7 @@ describe('Testing component button', () => { it('with icon only', () => { const onPress = jest.fn() const { getByTestId, toJSON } = render( -