James Moger
2013-12-11 619291b080176f65b85fe9ca4d0df56cb9ad8393
Fix NPE on usermodel account type checking

Change-Id: I964381a896e8c8bf8cce5f19a83fd7c33ef5c9bd
2 files modified
6 ■■■■■ changed files
src/main/java/com/gitblit/ConfigUserService.java 2 ●●● patch | view | raw | blame | history
src/main/java/com/gitblit/models/UserModel.java 4 ●●● patch | view | raw | blame | history
src/main/java/com/gitblit/ConfigUserService.java
@@ -859,7 +859,7 @@
                    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);
src/main/java/com/gitblit/models/UserModel.java
@@ -95,7 +95,9 @@
    }
    public boolean isLocalAccount() {
        return !Constants.EXTERNAL_ACCOUNT.equals(password) || accountType.isLocal();
        return !Constants.EXTERNAL_ACCOUNT.equals(password)
                || accountType == null
                || accountType.isLocal();
    }
    /**