[java-support] branch main updated: Add null check.

Scott Cantor cantor.2 at osu.edu
Tue Oct 20 14:45:56 UTC 2020


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-support.

View the commit online:
http://git.shibboleth.net/view/?p=java-support.git;a=commit;h=76b5f18556d5aa7d4649211b65f4440878b861e3

The following commit(s) were added to refs/heads/main by this push:
       new  76b5f18   Add null check.
76b5f18 is described below

commit 76b5f18556d5aa7d4649211b65f4440878b861e3
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Oct 20 10:45:54 2020 -0400

    Add null check.
---
 .../net/shibboleth/utilities/java/support/net/HttpServletSupport.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/net/shibboleth/utilities/java/support/net/HttpServletSupport.java b/src/main/java/net/shibboleth/utilities/java/support/net/HttpServletSupport.java
index df0c27e..e189305 100644
--- a/src/main/java/net/shibboleth/utilities/java/support/net/HttpServletSupport.java
+++ b/src/main/java/net/shibboleth/utilities/java/support/net/HttpServletSupport.java
@@ -172,7 +172,7 @@ public final class HttpServletSupport {
     @Nullable public static String getRemoteAddr(@Nonnull final ServletRequest request) {
         final String addr = request.getRemoteAddr();
         
-        if (addr.startsWith("[") && addr.endsWith("]")) {
+        if (addr != null && addr.startsWith("[") && addr.endsWith("]")) {
             return addr.substring(1, addr.length() - 1);
         }
         

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list