User: ejort
Date: 02/01/03 09:21:50
Modified: src/main/org/jboss/mq SpyBytesMessage.java
Log:
Guard against an NPE for acknowledged messages without reads.
Revision Changes Path
1.6 +7 -2 jbossmq/src/main/org/jboss/mq/SpyBytesMessage.java
Index: SpyBytesMessage.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/SpyBytesMessage.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SpyBytesMessage.java 2001/11/14 01:53:39 1.5
+++ SpyBytesMessage.java 2002/01/03 17:21:50 1.6
@@ -18,7 +18,7 @@
*
* @author Norbert Lataille ([EMAIL PROTECTED])
* @created August 16, 2001
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public class SpyBytesMessage
extends SpyMessage
@@ -385,7 +385,12 @@
if ( !header.msgReadOnly ) {
ostream.close();
} else {
- istream.close();
+ // REVIEW: istream is only initialised on a read.
+ // It looks like it is possible to acknowledge
+ // a message without reading it? Guard against
+ // an NPE in this case.
+ if (istream != null)
+ istream.close();
}
} catch ( IOException e ) {
//don't throw an exception
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development