mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-16 21:06:35 +08:00
Fix(challenge): Harden reducer against bad data fetch
This commit is contained in:
parent
b3bab2c312
commit
76c49b3a4a
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user