diff options
author | James Moger <james.moger@gitblit.com> | 2013-12-11 10:29:25 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2013-12-11 10:29:25 -0500 |
commit | 619291b080176f65b85fe9ca4d0df56cb9ad8393 (patch) | |
tree | 6b9f84a013bbf26dbba0490116838d7b2af88112 /src/main | |
parent | c1b0e4a5a3acc31bd469cf498d1ba7d390c379b2 (diff) | |
download | gitblit-619291b080176f65b85fe9ca4d0df56cb9ad8393.tar.gz gitblit-619291b080176f65b85fe9ca4d0df56cb9ad8393.zip |
Fix NPE on usermodel account type checking
Change-Id: I964381a896e8c8bf8cce5f19a83fd7c33ef5c9bd
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/gitblit/ConfigUserService.java | 2 | ||||
-rw-r--r-- | src/main/java/com/gitblit/models/UserModel.java | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/com/gitblit/ConfigUserService.java b/src/main/java/com/gitblit/ConfigUserService.java index aae7c14c..c1f0506d 100644 --- a/src/main/java/com/gitblit/ConfigUserService.java +++ b/src/main/java/com/gitblit/ConfigUserService.java @@ -859,7 +859,7 @@ public class ConfigUserService implements IUserService { user.emailAddress = config.getString(USER, username, EMAILADDRESS);
user.accountType = AccountType.fromString(config.getString(USER, username, ACCOUNTTYPE));
if (Constants.EXTERNAL_ACCOUNT.equals(user.password) && user.accountType.isLocal()) {
- user.accountType = null;
+ user.accountType = AccountType.EXTERNAL;
}
user.organizationalUnit = config.getString(USER, username, ORGANIZATIONALUNIT);
user.organization = config.getString(USER, username, ORGANIZATION);
diff --git a/src/main/java/com/gitblit/models/UserModel.java b/src/main/java/com/gitblit/models/UserModel.java index 6e8de402..3c33bd32 100644 --- a/src/main/java/com/gitblit/models/UserModel.java +++ b/src/main/java/com/gitblit/models/UserModel.java @@ -95,7 +95,9 @@ public class UserModel implements Principal, Serializable, Comparable<UserModel> }
public boolean isLocalAccount() {
- return !Constants.EXTERNAL_ACCOUNT.equals(password) || accountType.isLocal();
+ return !Constants.EXTERNAL_ACCOUNT.equals(password)
+ || accountType == null
+ || accountType.isLocal();
}
/**
|