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:52:45 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 3c646bb34 -> 7b69f62de


[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/7b69f62d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/7b69f62d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/7b69f62d

Branch: refs/heads/2.7.x-fixes
Commit: 7b69f62deb8be6912e0b2ba1f37920dc42cee1ce
Parents: 3c646bb
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:52:23 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/7b69f62d/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java b/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
index 7ca5877..ec58aa5 100644
--- a/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
+++ b/api/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