Author: dkulp
Date: Wed Dec 16 16:42:43 2009
New Revision: 891302

URL: http://svn.apache.org/viewvc?rev=891302&view=rev
Log:
Merged revisions 891301 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r891301 | dkulp | 2009-12-16 11:41:38 -0500 (Wed, 16 Dec 2009) | 1 line
  
  [CXF-2584] NPE guards for CXFAuthenticator
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    
cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/CXFAuthenticator.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Dec 16 16:42:43 2009
@@ -1 +1 @@
-/cxf/trunk:890614,890633-890756,890819,890957,891036-891037
+/cxf/trunk:890614,890633-890756,890819,890957,891036-891037,891301

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: 
cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/CXFAuthenticator.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/CXFAuthenticator.java?rev=891302&r1=891301&r2=891302&view=diff
==============================================================================
--- 
cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/CXFAuthenticator.java
 (original)
+++ 
cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/CXFAuthenticator.java
 Wed Dec 16 16:42:43 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());
+                    }
                 }
             }
         }


Reply via email to