You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ha...@apache.org on 2003/04/14 06:50:00 UTC
cvs commit: xml-axis/java/src/org/apache/axis Message.java
haddadc 2003/04/13 21:50:00
Modified: java/src/org/apache/axis Message.java
Log:
client side calls to getAttachments() threw NPE if no attachments are present. added a check.
reported by Vlad <vu...@adjoin.com>
PR:18984
Revision Changes Path
1.96 +4 -2 xml-axis/java/src/org/apache/axis/Message.java
Index: Message.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/Message.java,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -r1.95 -r1.96
--- Message.java 20 Mar 2003 13:26:42 -0000 1.95
+++ Message.java 14 Apr 2003 04:50:00 -0000 1.96
@@ -192,7 +192,7 @@
public Message(Object initialContents, boolean bodyInStream, MimeHeaders headers) {
setup(initialContents, bodyInStream, null, null, headers);
}
-
+
/**
* Construct a Message, using the provided initialContents as the
* contents of the Message's SOAPPart.
@@ -562,7 +562,9 @@
*/
public Iterator getAttachments(){
try {
- return mAttachments.getAttachments().iterator();
+ if (mAttachments != null && 0 != mAttachments.getAttachmentCount()) {
+ return mAttachments.getAttachments().iterator();
+ }
} catch (AxisFault af){
log.error(Messages.getMessage("exception00"), af);
}