Repository: cxf Updated Branches: refs/heads/master 0696b1660 -> ddc01a185
[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/ddc01a18 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/ddc01a18 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/ddc01a18 Branch: refs/heads/master Commit: ddc01a185658418ce8b68ebf5e1a57c1a7de06ce Parents: 0696b16 Author: Sergey Beryozkin <sberyoz...@gmail.com> Authored: Tue Aug 4 14:46:09 2015 +0100 Committer: Sergey Beryozkin <sberyoz...@gmail.com> Committed: Tue Aug 4 14:46:09 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/ddc01a18/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; }