From 1ebc0c9dd87764a8ffb3bec3e9f12270177776d3 Mon Sep 17 00:00:00 2001 From: Eko Eryanto <36023898+ekoeryanto@users.noreply.github.com> Date: Wed, 25 Apr 2018 08:44:13 +0700 Subject: [PATCH] Safely convert to string (#1240) --- src/reducers/auth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reducers/auth.js b/src/reducers/auth.js index caaffa98..d4879743 100644 --- a/src/reducers/auth.js +++ b/src/reducers/auth.js @@ -8,7 +8,7 @@ const auth = (state = null, action) => { case AUTH_SUCCESS: return Immutable.fromJS({ user: action.payload }); case AUTH_FAILURE: - return Immutable.Map({ error: action.payload.toString() }); + return Immutable.Map({ error: action.payload && action.payload.toString() }); case AUTH_REQUEST_DONE: return state.remove('isFetching'); case LOGOUT: