cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6517] Avoiding NPE
Date Tue, 04 Aug 2015 13:47:14 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes f5c08c526 -> 9fe0b1b71


[CXF-6517] Avoiding NPE


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/9fe0b1b7
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/9fe0b1b7
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/9fe0b1b7

Branch: refs/heads/3.0.x-fixes
Commit: 9fe0b1b71b65182f1db58a7c9cf96e36bec89c26
Parents: f5c08c5
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Tue Aug 4 14:46:09 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Tue Aug 4 14:46:55 2015 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/attachment/AttachmentUtil.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/9fe0b1b7/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java b/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
index a054ca2..18b198f 100644
--- a/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
+++ b/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
@@ -199,7 +199,12 @@ public final class AttachmentUtil {
         if (ns != null && (ns.length() > 0)) {
             try {
                 URI uri = new URI(ns);
-                cid = uri.getHost();
+                String host = uri.getHost();
+                if (host != null) {
+                    cid = host;
+                } else {
+                    cid = ns;
+                }
             } catch (Exception e) {
                 cid = ns;
             }


Mime
View raw message