Author: rhs
Date: Thu Aug 22 16:37:40 2013
New Revision: 1516508

URL: http://svn.apache.org/r1516508
Log:
PROTON-58: throw illegal state instead of NPE

Modified:
    
qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/ReceiverImpl.java

Modified: 
qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/ReceiverImpl.java
URL: 
http://svn.apache.org/viewvc/qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/ReceiverImpl.java?rev=1516508&r1=1516507&r2=1516508&view=diff
==============================================================================
--- 
qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/ReceiverImpl.java
 (original)
+++ 
qpid/proton/trunk/proton-j/proton/src/main/java/org/apache/qpid/proton/engine/impl/ReceiverImpl.java
 Thu Aug 22 16:37:40 2013
@@ -77,6 +77,10 @@ public class ReceiverImpl extends LinkIm
 
     public int recv(final byte[] bytes, int offset, int size)
     {
+        if (_current == null) {
+            throw new IllegalStateException("no current delivery");
+        }
+
         int consumed = _current.recv(bytes, offset, size);
         if (consumed > 0) {
             getSession().incrementIncomingBytes(-consumed);



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to