NPE in taglib processing.
[java-idp.git] / src / main / java / edu / internet2 / middleware / shibboleth / idp / ui / ServiceTagSupport.java
index f0d9a5a..c695d2d 100644 (file)
@@ -122,12 +122,18 @@ public class ServiceTagSupport extends BodyTagSupport{
         request = (HttpServletRequest) pageContext.getRequest();\r
         application = pageContext.getServletContext();\r
         \r
+        if (request == null || application == null) {\r
+           return null;\r
+        }\r
         //\r
         // grab the login context and the RP config mgr.\r
         //\r
         loginContext = HttpServletHelper.getLoginContext(HttpServletHelper.getStorageService(application),\r
                 application, request);\r
-        rpConfigMngr = HttpServletHelper.getRelyingPartyConfigurationManager(application);       \r
+        rpConfigMngr = HttpServletHelper.getRelyingPartyConfigurationManager(application);\r
+        if (loginContext == null || rpConfigMngr == null) {\r
+            return null;\r
+        }\r
         spEntity = HttpServletHelper.getRelyingPartyMetadata(loginContext.getRelyingPartyId(), rpConfigMngr);\r
 \r
         return spEntity;\r