cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf-fediz git commit: NPE fix
Date Tue, 10 Mar 2015 16:16:59 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master dd161ea29 -> b409d4755


NPE fix


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

Branch: refs/heads/master
Commit: b409d475590b165537aea8cd3762e0442c9483ba
Parents: dd161ea
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Mar 10 16:16:45 2015 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Mar 10 16:16:45 2015 +0000

----------------------------------------------------------------------
 .../idp/beans/SigninParametersCacheAction.java  | 35 +++++++++++---------
 1 file changed, 20 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/b409d475/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/SigninParametersCacheAction.java
----------------------------------------------------------------------
diff --git a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/SigninParametersCacheAction.java
b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/SigninParametersCacheAction.java
index b1525df..93fab36 100644
--- a/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/SigninParametersCacheAction.java
+++ b/services/idp/src/main/java/org/apache/cxf/fediz/service/idp/beans/SigninParametersCacheAction.java
@@ -76,22 +76,27 @@ public class SigninParametersCacheAction {
         Map<String, Object> signinParams =
             (Map<String, Object>)WebUtils.getAttributeFromExternalContext(context,
uuidKey);
         
-        String value = (String)signinParams.get(FederationConstants.PARAM_REPLY);
-        if (value != null) {
-            WebUtils.putAttributeInFlowScope(context, FederationConstants.PARAM_REPLY, value);
-        }
-        value = (String)signinParams.get(FederationConstants.PARAM_TREALM);
-        if (value != null) {
-            WebUtils.putAttributeInFlowScope(context, FederationConstants.PARAM_TREALM, value);
-        }
-        value = (String)signinParams.get(FederationConstants.PARAM_HOME_REALM);
-        if (value != null) {
-            WebUtils.putAttributeInFlowScope(context, FederationConstants.PARAM_HOME_REALM,
value);
+        if (signinParams != null) {
+            String value = (String)signinParams.get(FederationConstants.PARAM_REPLY);
+            if (value != null) {
+                WebUtils.putAttributeInFlowScope(context, FederationConstants.PARAM_REPLY,
value);
+            }
+            value = (String)signinParams.get(FederationConstants.PARAM_TREALM);
+            if (value != null) {
+                WebUtils.putAttributeInFlowScope(context, FederationConstants.PARAM_TREALM,
value);
+            }
+            value = (String)signinParams.get(FederationConstants.PARAM_HOME_REALM);
+            if (value != null) {
+                WebUtils.putAttributeInFlowScope(context, FederationConstants.PARAM_HOME_REALM,
value);
+            }
+            
+            LOG.debug("SignIn parameters restored: {}", signinParams.toString());
+            WebUtils.removeAttributeFromFlowScope(context, FederationConstants.PARAM_CONTEXT);
+            LOG.info("SignIn parameters restored and " + FederationConstants.PARAM_CONTEXT
+ "[" 
+                + uuidKey + "] cleared.");
+        } else {
+            LOG.debug("Error in restoring security context");
         }
-        
-        LOG.debug("SignIn parameters restored: {}", signinParams.toString());
-        WebUtils.removeAttributeFromFlowScope(context, FederationConstants.PARAM_CONTEXT);
-        LOG.info("SignIn parameters restored and " + FederationConstants.PARAM_CONTEXT +
"[" + uuidKey + "] cleared.");
     }
 
     public void storeRPUrlInSession(RequestContext context) throws ProcessingException {


Mime
View raw message