From 3ee6f02068aaa1f15c704cf29d4271dc917fbf6f Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Tue, 22 Oct 2013 14:14:31 +0100 Subject: [PATCH] Fix for KEYCLOAK-116 --- .../java/org/keycloak/services/FormService.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/services/src/main/java/org/keycloak/services/FormService.java b/services/src/main/java/org/keycloak/services/FormService.java index 02e4af9e0d..210fad6b1e 100755 --- a/services/src/main/java/org/keycloak/services/FormService.java +++ b/services/src/main/java/org/keycloak/services/FormService.java @@ -88,18 +88,20 @@ public interface FormService { private String contextPath; - public FormServiceDataBean(RealmModel realm, UserModel userModel, MultivaluedMap formData, String message){ + public FormServiceDataBean(RealmModel realm, UserModel userModel, MultivaluedMap formData, String message) { this.realm = realm; this.userModel = userModel; this.formData = formData; this.message = message; socialProviders = new LinkedList(); - HashMap socialConfig = realm.getSocialConfig(); - for (Iterator itr = ServiceRegistry.lookupProviders(org.keycloak.social.SocialProvider.class); itr.hasNext();) { - SocialProvider p = itr.next(); - if (socialConfig.containsKey(p.getId() + ".key") && socialConfig.containsKey(p.getId() + ".secret")) { - socialProviders.add(p); + HashMap socialConfig = realm.getSocialConfig(); + if (socialConfig != null) { + for (Iterator itr = ServiceRegistry.lookupProviders(org.keycloak.social.SocialProvider.class); itr.hasNext(); ) { + SocialProvider p = itr.next(); + if (socialConfig.containsKey(p.getId() + ".key") && socialConfig.containsKey(p.getId() + ".secret")) { + socialProviders.add(p); + } } } }