Allow empty responses

Fixes  by not assuming there is any body associated with the response.  That we don't send one is news to me, but we should cover this possibility in any case.
This commit is contained in:
Ray Schamp 2016-12-19 13:43:33 -05:00
parent d38a2d89c9
commit 3b396019ab
2 changed files with 2 additions and 2 deletions
src/views
studentregistration
teacherregistration

View file

@ -81,7 +81,7 @@ var StudentRegistration = intl.injectIntl(React.createClass({
}, function (err, body, res) {
this.setState({waiting: false});
if (err) return this.setState({registrationError: err});
if (body[0].success) return this.advanceStep(formData);
if (body[0] && body[0].success) return this.advanceStep(formData);
this.setState({
registrationError:
body[0].msg ||

View file

@ -69,7 +69,7 @@ var TeacherRegistration = React.createClass({
}, function (err, body, res) {
this.setState({waiting: false});
if (err) return this.setState({registrationError: err});
if (body[0].success) {
if (body[0] && body[0].success) {
this.props.dispatch(sessionActions.refreshSession());
return this.advanceStep(formData);
}