diff --git a/src/views/studentregistration/studentregistration.jsx b/src/views/studentregistration/studentregistration.jsx index 7a58c4424..b9ae15fae 100644 --- a/src/views/studentregistration/studentregistration.jsx +++ b/src/views/studentregistration/studentregistration.jsx @@ -84,7 +84,7 @@ var StudentRegistration = intl.injectIntl(React.createClass({ if (body[0] && body[0].success) return this.advanceStep(formData); this.setState({ registrationError: - body[0].msg || + (body[0] && body[0].msg) || this.props.intl.formatMessage({id: 'registration.generalError'}) + ' (' + res.statusCode + ')' }); }.bind(this)); diff --git a/src/views/teacherregistration/teacherregistration.jsx b/src/views/teacherregistration/teacherregistration.jsx index b4954f3dd..c4ac97dc7 100644 --- a/src/views/teacherregistration/teacherregistration.jsx +++ b/src/views/teacherregistration/teacherregistration.jsx @@ -75,7 +75,7 @@ var TeacherRegistration = React.createClass({ } this.setState({ registrationError: - body[0].msg || + (body[0] && body[0].msg) || this.props.intl.formatMessage({id: 'registration.generalError'}) + ' (' + res.statusCode + ')' }); }.bind(this));