You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2017/03/10 13:22:57 UTC

cxf-fediz git commit: [FEDIZ-174] Fixing NPE when restarting Fediz OIDC after using dynamic registration, patch from Adrian Gonzalez applied, This closes #13

Repository: cxf-fediz
Updated Branches:
  refs/heads/master 33a7e179c -> 3844b0046


[FEDIZ-174] Fixing NPE when restarting Fediz OIDC after using dynamic registration, patch from Adrian Gonzalez applied, This closes #13


Project: http://git-wip-us.apache.org/repos/asf/cxf-fediz/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-fediz/commit/3844b004
Tree: http://git-wip-us.apache.org/repos/asf/cxf-fediz/tree/3844b004
Diff: http://git-wip-us.apache.org/repos/asf/cxf-fediz/diff/3844b004

Branch: refs/heads/master
Commit: 3844b00467c43808c728b4078f3fb3d82256ec94
Parents: 33a7e17
Author: Sergey Beryozkin <sb...@gmail.com>
Authored: Fri Mar 10 13:22:42 2017 +0000
Committer: Sergey Beryozkin <sb...@gmail.com>
Committed: Fri Mar 10 13:22:42 2017 +0000

----------------------------------------------------------------------
 .../oidc/clients/ClientRegistrationService.java     | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/3844b004/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/clients/ClientRegistrationService.java
----------------------------------------------------------------------
diff --git a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/clients/ClientRegistrationService.java b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/clients/ClientRegistrationService.java
index 4848a55..a4859ca 100644
--- a/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/clients/ClientRegistrationService.java
+++ b/services/oidc/src/main/java/org/apache/cxf/fediz/service/oidc/clients/ClientRegistrationService.java
@@ -422,14 +422,16 @@ public class ClientRegistrationService {
 
     public void init() {
         for (Client c : clientProvider.getClients(null)) {
-            String userName = c.getResourceOwnerSubject().getLogin();
-            getClientRegistrations(userName).add(c);
-            Set<String> names = clientNames.get(userName);
-            if (names == null) {
-                names = new HashSet<>();
-                clientNames.put(userName, names);
+            if (c.getResourceOwnerSubject() != null) {
+                String userName = c.getResourceOwnerSubject().getLogin();
+                getClientRegistrations(userName).add(c);
+                Set<String> names = clientNames.get(userName);
+                if (names == null) {
+                    names = new HashSet<>();
+                    clientNames.put(userName, names);
+                }
+                names.add(c.getApplicationName());
             }
-            names.add(c.getApplicationName());
         }
     }