cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r891301 - /cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/CXFAuthenticator.java
Date Wed, 16 Dec 2009 16:41:39 GMT
Author: dkulp
Date: Wed Dec 16 16:41:38 2009
New Revision: 891301

URL: http://svn.apache.org/viewvc?rev=891301&view=rev
Log:
[CXF-2584] NPE guards for CXFAuthenticator

Modified:
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/CXFAuthenticator.java

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/CXFAuthenticator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/CXFAuthenticator.java?rev=891301&r1=891300&r2=891301&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/CXFAuthenticator.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/CXFAuthenticator.java
Wed Dec 16 16:41:38 2009
@@ -87,15 +87,18 @@
                 HTTPConduit httpConduit = (HTTPConduit)conduit;
                 if (getRequestorType() == RequestorType.PROXY
                     && httpConduit.getProxyAuthorization() != null) {
-                    
-                    auth = new PasswordAuthentication(httpConduit.getProxyAuthorization().getUserName(),
-                                                      httpConduit.getProxyAuthorization()
-                                                          .getPassword().toCharArray());
+                    String un = httpConduit.getProxyAuthorization().getUserName();
+                    String pwd =  httpConduit.getProxyAuthorization().getPassword();
+                    if (un != null && pwd != null) {
+                        auth = new PasswordAuthentication(un, pwd.toCharArray());
+                    }
                 } else if (getRequestorType() == RequestorType.SERVER
                     && httpConduit.getAuthorization() != null) {
-                    auth = new PasswordAuthentication(httpConduit.getAuthorization().getUserName(),
-                                                      httpConduit.getAuthorization()
-                                                          .getPassword().toCharArray());
+                    String un = httpConduit.getAuthorization().getUserName();
+                    String pwd =  httpConduit.getAuthorization().getPassword();
+                    if (un != null && pwd != null) {
+                        auth = new PasswordAuthentication(un, pwd.toCharArray());
+                    }
                 }
             }
         }



Mime
View raw message