KEYCLOAK-3737
Migration problem from version 1.9.8 to 2.2.1
This commit is contained in:
parent
f2f508ac2e
commit
24715eabec
1 changed files with 2 additions and 2 deletions
|
@ -33,7 +33,7 @@ public class MigrationUtils {
|
|||
|
||||
public static void addAdminRole(RealmModel realm, String roleName) {
|
||||
ClientModel client = realm.getMasterAdminClient();
|
||||
if (client.getRole(roleName) == null) {
|
||||
if (client != null && client.getRole(roleName) == null) {
|
||||
RoleModel role = client.addRole(roleName);
|
||||
role.setDescription("${role_" + roleName + "}");
|
||||
role.setScopeParamRequired(false);
|
||||
|
@ -43,7 +43,7 @@ public class MigrationUtils {
|
|||
|
||||
if (!realm.getName().equals(Config.getAdminRealm())) {
|
||||
client = realm.getClientByClientId(Constants.REALM_MANAGEMENT_CLIENT_ID);
|
||||
if (client.getRole(roleName) == null) {
|
||||
if (client != null && client.getRole(roleName) == null) {
|
||||
RoleModel role = client.addRole(roleName);
|
||||
role.setDescription("${role_" + roleName + "}");
|
||||
role.setScopeParamRequired(false);
|
||||
|
|
Loading…
Reference in a new issue