Skip to content

Commit

Permalink
Merge pull request #4 from patrix/no-response-text
Browse files Browse the repository at this point in the history
No response text
  • Loading branch information
patrix authored Nov 28, 2018
2 parents 231e929 + 22024c4 commit 47e1ad9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ function fetchDirections() {
dispatch(destinationPoint(data.waypoints[data.waypoints.length - 1].location));
} else {
dispatch(setDirections([]));
return dispatch(setError(JSON.parse(request.responseText).message));
return dispatch(setError(JSON.parse(request.responseText || '{"message": "Undefined error"}').message));
}
};

request.onerror = () => {
dispatch(setDirections([]));
return dispatch(setError(JSON.parse(request.responseText).message));
return dispatch(setError(JSON.parse(request.responseText || '{"message": "Undefined error"}').message));
};

request.send();
Expand Down

0 comments on commit 47e1ad9

Please sign in to comment.