From 76c49b3a4a97c845afa27c33fcaa7009fdfae14b Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Fri, 9 Sep 2016 00:08:59 -0700 Subject: [PATCH] Fix(challenge): Harden reducer against bad data fetch --- common/app/routes/challenges/redux/reducer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/app/routes/challenges/redux/reducer.js b/common/app/routes/challenges/redux/reducer.js index 7c88d212d1..435cffccf8 100644 --- a/common/app/routes/challenges/redux/reducer.js +++ b/common/app/routes/challenges/redux/reducer.js @@ -68,7 +68,7 @@ const mainReducer = handleActions( ...state, challenge: payload }), - [types.updateCurrentChallenge]: (state, { payload: challenge }) => ({ + [types.updateCurrentChallenge]: (state, { payload: challenge = {} }) => ({ ...state, id: challenge.id, // used mainly to find code storage