Safely convert to string (#1240)

This commit is contained in:
Eko Eryanto 2018-04-25 08:44:13 +07:00 committed by Shawn Erquhart
parent 855bfde79b
commit 1ebc0c9dd8

View File

@ -8,7 +8,7 @@ const auth = (state = null, action) => {
case AUTH_SUCCESS: case AUTH_SUCCESS:
return Immutable.fromJS({ user: action.payload }); return Immutable.fromJS({ user: action.payload });
case AUTH_FAILURE: case AUTH_FAILURE:
return Immutable.Map({ error: action.payload.toString() }); return Immutable.Map({ error: action.payload && action.payload.toString() });
case AUTH_REQUEST_DONE: case AUTH_REQUEST_DONE:
return state.remove('isFetching'); return state.remove('isFetching');
case LOGOUT: case LOGOUT: