qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1227162 - /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoredMemoryMessage.java
Date Wed, 04 Jan 2012 13:55:37 GMT
Author: rgodfrey
Date: Wed Jan  4 13:55:37 2012
New Revision: 1227162

URL: http://svn.apache.org/viewvc?rev=1227162&view=rev
Log:
QPID-3714 : Fix for NPE when a transient message (or when using the Memory Store) has no body

Modified:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoredMemoryMessage.java

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoredMemoryMessage.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoredMemoryMessage.java?rev=1227162&r1=1227161&r2=1227162&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoredMemoryMessage.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoredMemoryMessage.java
Wed Jan  4 13:55:37 2012
@@ -84,6 +84,10 @@ public class StoredMemoryMessage impleme
 
     public int getContent(int offset, ByteBuffer dst)
     {
+        if(_content == null)
+        {
+            return 0;
+        }
         ByteBuffer src = _content.duplicate();
 
         int oldPosition = src.position();
@@ -102,6 +106,10 @@ public class StoredMemoryMessage impleme
 
     public ByteBuffer getContent(int offsetInMessage, int size)
     {
+        if(_content == null)
+        {
+            return null;
+        }
         ByteBuffer buf = _content.duplicate();
 
         if(offsetInMessage != 0)



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message