From 7cc63497859636e37fe4dcb9a3a74b02b1abec0d Mon Sep 17 00:00:00 2001 From: Agustin Pane Date: Thu, 21 May 2020 14:57:03 -0300 Subject: [PATCH] Fix: app crashing when safe address is null (#947) * - Fixs non null check on notificationsMiddleware.ts * - Fixs non null check on notificationsMiddleware.ts * - Removes yarn.lock changes --- src/routes/safe/store/middleware/notificationsMiddleware.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/routes/safe/store/middleware/notificationsMiddleware.ts b/src/routes/safe/store/middleware/notificationsMiddleware.ts index be838e70..bea90187 100644 --- a/src/routes/safe/store/middleware/notificationsMiddleware.ts +++ b/src/routes/safe/store/middleware/notificationsMiddleware.ts @@ -152,7 +152,11 @@ const notificationsMiddleware = (store) => (next) => async (action) => { } case ADD_SAFE: { const state = store.getState() - const currentSafeAddress = safeParamAddressFromStateSelector(state) + const { safe } = action.payload + const currentSafeAddress = safeParamAddressFromStateSelector(state) || safe.address + if (!currentSafeAddress) { + break + } const isUserOwner = grantedSelector(state) const { needUpdate } = await getSafeVersionInfo(currentSafeAddress)