[java-identity-provider COMMIT] in /trunk: idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filte...

noreply at shibboleth.net noreply at shibboleth.net
Mon Oct 3 21:36:45 EDT 2016


Author: scantor
Date: Mon Oct  3 21:36:45 2016
New Revision: 8458

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=8458&view=rev
Log:
Add NPE checks while looking up contexts.

Modified:
    trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/impl/AttributeFilterImpl.java
    trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImpl.java

Modified: trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/impl/AttributeFilterImpl.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/impl/AttributeFilterImpl.java?rev=8458&r1=8457&r2=8458&view=diff
==============================================================================
--- trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/impl/AttributeFilterImpl.java	(original)
+++ trunk/idp-attribute-filter-impl/src/main/java/net/shibboleth/idp/attribute/filter/impl/AttributeFilterImpl.java	Mon Oct  3 21:36:45 2016
@@ -228,10 +228,13 @@
      * @return true iff the {@link #stopTimer(AttributeFilterContext)} method needs to be called
      */
     private boolean startTimer(@Nonnull final AttributeFilterContext filterContext) {
-        final TimerContext timerCtx = profileContextStrategy.apply(filterContext).getSubcontext(TimerContext.class);
-        if (timerCtx != null) {
-            timerCtx.start(getId());
-            return true;
+        final ProfileRequestContext prc = profileContextStrategy.apply(filterContext);
+        if (prc != null) {
+            final TimerContext timerCtx = prc.getSubcontext(TimerContext.class);
+            if (timerCtx != null) {
+                timerCtx.start(getId());
+                return true;
+            }
         }
         return false;
     }
@@ -242,9 +245,12 @@
      * @param filterContext attribute filtering context
      */
     private void stopTimer(@Nonnull final AttributeFilterContext filterContext) {
-        final TimerContext timerCtx = profileContextStrategy.apply(filterContext).getSubcontext(TimerContext.class);
-        if (timerCtx != null) {
-            timerCtx.stop(getId());
+        final ProfileRequestContext prc = profileContextStrategy.apply(filterContext);
+        if (prc != null) {
+            final TimerContext timerCtx = prc.getSubcontext(TimerContext.class);
+            if (timerCtx != null) {
+                timerCtx.stop(getId());
+            }
         }
     }
 

Modified: trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImpl.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImpl.java?rev=8458&r1=8457&r2=8458&view=diff
==============================================================================
--- trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImpl.java	(original)
+++ trunk/idp-attribute-resolver-impl/src/main/java/net/shibboleth/idp/attribute/resolver/impl/AttributeResolverImpl.java	Mon Oct  3 21:36:45 2016
@@ -585,10 +585,13 @@
      * @return true iff the {@link #stopTimer(AttributeResolutionContext)} method needs to be called
      */
     private boolean startTimer(@Nonnull final AttributeResolutionContext resolutionContext) {
-        final TimerContext timerCtx = profileContextStrategy.apply(resolutionContext).getSubcontext(TimerContext.class);
-        if (timerCtx != null) {
-            timerCtx.start(getId());
-            return true;
+        final ProfileRequestContext prc = profileContextStrategy.apply(resolutionContext);
+        if (prc != null) {
+            final TimerContext timerCtx = prc.getSubcontext(TimerContext.class);
+            if (timerCtx != null) {
+                timerCtx.start(getId());
+                return true;
+            }
         }
         return false;
     }
@@ -599,9 +602,12 @@
      * @param resolutionContext attribute resolution context
      */
     private void stopTimer(@Nonnull final AttributeResolutionContext resolutionContext) {
-        final TimerContext timerCtx = profileContextStrategy.apply(resolutionContext).getSubcontext(TimerContext.class);
-        if (timerCtx != null) {
-            timerCtx.stop(getId());
+        final ProfileRequestContext prc = profileContextStrategy.apply(resolutionContext);
+        if (prc != null) {
+            final TimerContext timerCtx = prc.getSubcontext(TimerContext.class);
+            if (timerCtx != null) {
+                timerCtx.stop(getId());
+            }
         }
     }
     



More information about the commits mailing list