mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-03-25 20:29:45 -04:00
Allow empty responses
Fixes #1124 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:
parent
d38a2d89c9
commit
3b396019ab
2 changed files with 2 additions and 2 deletions
src/views
|
@ -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 ||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue