KEYCLOAK-2149 Fix possible NPE during migration

This commit is contained in:
mposolda committed 2015-12-01 11:41:32 +01:00
1 parent b3ea8f3add
commit 32fb604c88
1 file changed
+4
@@ -429,6 +429,10 @@ public class DefaultAuthenticationFlows {
if (migrate) {
// Try to read OTP requirement from browser flow
AuthenticationFlowModel browserFlow = realm.getBrowserFlow();
if (browserFlow == null) {
browserFlow = realm.getFlowByAlias(DefaultAuthenticationFlows.BROWSER_FLOW);
}
List<AuthenticationExecutionModel> browserExecutions = new LinkedList<>();
KeycloakModelUtils.deepFindAuthenticationExecutions(realm, browserFlow, browserExecutions);
for (AuthenticationExecutionModel browserExecution : browserExecutions) {