From bc377308909ebaae1076317f5b09ebef6eda47f5 Mon Sep 17 00:00:00 2001 From: david_calavera Date: Wed, 24 Sep 2008 09:35:09 +0000 Subject: [PATCH] fixes 2376: NPE when completing the user signup for a new user account git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@12277 71c3de6d-444a-0410-be80-ed276b4c234a --- .../main/java/hudson/security/HudsonPrivateSecurityRealm.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java b/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java index 011efdf428..8cabce1010 100644 --- a/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java +++ b/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java @@ -122,10 +122,10 @@ public class HudsonPrivateSecurityRealm extends SecurityRealm implements ModelOb if(selfRegistration && !validateCaptcha(si.captcha)) si.errorMessage = "Text didn't match the word shown in the image"; - if(!si.password1.equals(si.password2)) + if(si.password1 != null && !si.password1.equals(si.password2)) si.errorMessage = "Password didn't match"; - if(si.password1.length()==0) + if(!(si.password1 != null && si.password1.length() != 0)) si.errorMessage = "Password is required"; if(si.username.length()==0)