Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1136 from 18F/lkb-invite_validation
Browse files Browse the repository at this point in the history
Prevent the javascript error with failed email value
  • Loading branch information
jcscottiii authored Jun 26, 2017
2 parents 4c4006c + f83961d commit 3752428
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions static_src/components/users_invite.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,15 @@ export default class UsersInvite extends React.Component {
}

_onValidForm(errs, values) {
const email = values.email.value;
if (this.validateEmail(email, 'email') === null) {
let email = '';

if (values.email) {
email = values.email.value;
}

const isEmailValid = (this.validateEmail(email, 'email') === null);

if (isEmailValid) {
userActions.createUserInvite(email);
}
}
Expand Down

0 comments on commit 3752428

Please sign in to comment.