Merge pull request #1910 from mposolda/master

KEYCLOAK-2149 Fix possible NPE during migration
This commit is contained in:
Marek Posolda 2015-12-01 12:35:27 +01:00
commit 9d5356a001

View file

@ -429,6 +429,10 @@ public class DefaultAuthenticationFlows {
if (migrate) { if (migrate) {
// Try to read OTP requirement from browser flow // Try to read OTP requirement from browser flow
AuthenticationFlowModel browserFlow = realm.getBrowserFlow(); AuthenticationFlowModel browserFlow = realm.getBrowserFlow();
if (browserFlow == null) {
browserFlow = realm.getFlowByAlias(DefaultAuthenticationFlows.BROWSER_FLOW);
}
List<AuthenticationExecutionModel> browserExecutions = new LinkedList<>(); List<AuthenticationExecutionModel> browserExecutions = new LinkedList<>();
KeycloakModelUtils.deepFindAuthenticationExecutions(realm, browserFlow, browserExecutions); KeycloakModelUtils.deepFindAuthenticationExecutions(realm, browserFlow, browserExecutions);
for (AuthenticationExecutionModel browserExecution : browserExecutions) { for (AuthenticationExecutionModel browserExecution : browserExecutions) {