Skip to content

Commit

Permalink
Fix for usnistgov#53 Issue usnistgov#53
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirralev committed Jan 6, 2020
1 parent b586569 commit a15978d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gov/nist/javax/sip/header/SIPHeaderList.java
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,11 @@ protected StringBuilder encodeBody(StringBuilder buffer) {
while (true) {
SIPHeader sipHeader = (SIPHeader) iterator.next();
if ( sipHeader == this ) throw new RuntimeException ("Unexpected circularity in SipHeaderList");

//This determines if a null body was added https://github.com/usnistgov/jsip/issues/53
int buffPosDelta = buffer.length();
sipHeader.encodeBody(buffer);
buffPosDelta -= buffer.length();
buffPosDelta -= buffer.length(); // if 0 nothing was added to the buffer
// if (body.equals("")) System.out.println("BODY == ");
if (iterator.hasNext()) {
if(buffPosDelta != 0) {
Expand Down

0 comments on commit a15978d

Please sign in to comment.