From 6a37d83bd2cafa0b052915b11792b3cdbb7b47bf Mon Sep 17 00:00:00 2001 From: Chengwei Yang Date: Wed, 30 Sep 2015 09:26:12 +0800 Subject: Check team name in correct sequence to avoid null pointer Signed-off-by: Chengwei Yang --- web/react/components/team_signup_with_sso.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'web/react/components') diff --git a/web/react/components/team_signup_with_sso.jsx b/web/react/components/team_signup_with_sso.jsx index 9b8f4f16a..14f281f7a 100644 --- a/web/react/components/team_signup_with_sso.jsx +++ b/web/react/components/team_signup_with_sso.jsx @@ -23,12 +23,14 @@ export default class SSOSignUpPage extends React.Component { team.display_name = this.state.name; - if (team.display_name.length <= 2) { + if (!team.display_name) { + state.nameError = 'Please enter a team name'; + this.setState(state); return; } - if (!team.display_name) { - state.nameError = 'Please enter a team name'; + if (team.display_name.length <= 2) { + state.nameError = 'Name must be 3 or more characters up to a maximum of 15'; this.setState(state); return; } -- cgit v1.2.3-1-g7c22