Return-Path: Delivered-To: apmail-xml-axis-dev-archive@xml.apache.org Received: (qmail 23587 invoked by uid 500); 30 Aug 2002 17:18:00 -0000 Mailing-List: contact axis-dev-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@xml.apache.org Received: (qmail 23577 invoked by uid 500); 30 Aug 2002 17:17:59 -0000 Delivered-To: apmail-xml-axis-cvs@apache.org Date: 30 Aug 2002 17:17:59 -0000 Message-ID: <20020830171759.93152.qmail@icarus.apache.org> From: butek@apache.org To: xml-axis-cvs@apache.org Subject: cvs commit: xml-axis/java/src/org/apache/axis/encoding/ser JAFDataHandlerSerializer.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N butek 2002/08/30 10:17:59 Modified: java/src/org/apache/axis/encoding/ser JAFDataHandlerSerializer.java Log: Fixed (sorta) http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11781. That bug turned out to be user error, but the user was getting a very unfriendly NullPointerException. Now at least AXIS will tell the user: java.io.IOException: No support for attachments. Revision Changes Path 1.18 +8 -0 xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerSerializer.java Index: JAFDataHandlerSerializer.java =================================================================== RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/JAFDataHandlerSerializer.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- JAFDataHandlerSerializer.java 9 Jul 2002 11:28:25 -0000 1.17 +++ JAFDataHandlerSerializer.java 30 Aug 2002 17:17:58 -0000 1.18 @@ -111,6 +111,14 @@ DataHandler dh= (DataHandler)value; //Add the attachment content to the message. Attachments attachments= context.getCurrentMessage().getAttachmentsImpl(); + + if (attachments == null) { + // Attachments apparently aren't supported. + // Instead of throwing NullPointerException like + // we used to do, throw something meaningful. + throw new IOException(JavaUtils.getMessage("noAttachments")); + } + Part attachmentPart= attachments.createAttachmentPart(dh); AttributesImpl attrs = new AttributesImpl();