Fix NPE in MigrateTo21_0_0 when admin theme is not set explicitly (#17249)

Only update admin-console theme to keycloak.v2 if it is explicitly set to "keycloak" or "rh-sso".

Fixes #17248

Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
Co-authored-by: Stian Thorgersen <stian@redhat.com>
This commit is contained in:
Thomas Darimont 2023-02-23 16:37:59 +01:00 committed by GitHub
parent c9fdaf572b
commit 16efddc908
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,7 +25,7 @@ public class MigrateTo21_0_0 implements Migration {
private void updateAdminTheme(RealmModel realm) {
String adminTheme = realm.getAdminTheme();
if (adminTheme.equals("keycloak") || adminTheme.equals("rh-sso")) {
if ("keycloak".equals(adminTheme) || "rh-sso".equals(adminTheme)) {
realm.setAdminTheme("keycloak.v2");
}
}