cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [1/2] cxf-fediz git commit: NPE guard
Date Wed, 08 Feb 2017 16:43:10 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master e8aec20af -> 2bcb3b328


NPE guard


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

Branch: refs/heads/master
Commit: 841f380b914848743db284adfefede0621c524c7
Parents: e8aec20
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Wed Feb 8 16:21:00 2017 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Wed Feb 8 16:21:00 2017 +0000

----------------------------------------------------------------------
 .../core/processor/FederationProcessorImpl.java | 31 +++++++++++---------
 1 file changed, 17 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/841f380b/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FederationProcessorImpl.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FederationProcessorImpl.java
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FederationProcessorImpl.java
index fa8778e..88e8da1 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FederationProcessorImpl.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FederationProcessorImpl.java
@@ -574,14 +574,16 @@ public class FederationProcessorImpl extends AbstractFedizProcessor
{
                     callback
                 });
                 Map<String, String> signInQueryMap = callback.getSignInQueryParamMap();
-                StringBuilder sbQuery = new StringBuilder();
-                for (Entry<String, String> entry : signInQueryMap.entrySet()) {
-                    if (sbQuery.length() > 0) {
-                        sbQuery.append("&");
+                if (signInQueryMap != null) {
+                    StringBuilder sbQuery = new StringBuilder();
+                    for (Entry<String, String> entry : signInQueryMap.entrySet()) {
+                        if (sbQuery.length() > 0) {
+                            sbQuery.append("&");
+                        }
+                        sbQuery.append(entry.getKey()).append('=').append(URLEncoder.encode(entry.getValue(),
"UTF-8"));
                     }
-                    sbQuery.append(entry.getKey()).append('=').append(URLEncoder.encode(entry.getValue(),
"UTF-8"));
+                    signInQuery = sbQuery.toString();
                 }
-                signInQuery = sbQuery.toString();
 
             }
         }
@@ -601,16 +603,17 @@ public class FederationProcessorImpl extends AbstractFedizProcessor
{
                 frCB.handle(new Callback[] {
                     callback
                 });
-                Map<String, String> signInQueryMap = callback.getSignOutQueryParamMap();
-                StringBuilder sbQuery = new StringBuilder();
-                for (Entry<String, String> entry : signInQueryMap.entrySet()) {
-                    if (sbQuery.length() > 0) {
-                        sbQuery.append("&");
+                Map<String, String> signOutQueryMap = callback.getSignOutQueryParamMap();
+                if (signOutQueryMap != null) {
+                    StringBuilder sbQuery = new StringBuilder();
+                    for (Entry<String, String> entry : signOutQueryMap.entrySet())
{
+                        if (sbQuery.length() > 0) {
+                            sbQuery.append("&");
+                        }
+                        sbQuery.append(entry.getKey()).append('=').append(URLEncoder.encode(entry.getValue(),
"UTF-8"));
                     }
-                    sbQuery.append(entry.getKey()).append('=').append(URLEncoder.encode(entry.getValue(),
"UTF-8"));
+                    signOutQuery = sbQuery.toString();
                 }
-                signOutQuery = sbQuery.toString();
-    
             }
         }
         return signOutQuery;


Mime
View raw message