Handle case when we get acks with no recorded receipts

This commit is contained in:
Rob Harrop 2011-08-26 13:10:44 +01:00
parent 23b5e5bfd9
commit ad11737eb1
1 changed files with 5 additions and 1 deletions

View File

@ -717,7 +717,11 @@ accumulate_receipts(DeliveryTag, false, PR) ->
end;
accumulate_receipts(DeliveryTag, true, PR) ->
accumulate_receipts1(DeliveryTag, gb_trees:take_smallest(PR), []).
case gb_trees:is_empty(PR) of
true -> {[], PR};
false -> accumulate_receipts1(DeliveryTag,
gb_trees:take_smallest(PR), [])
end.
accumulate_receipts1(DeliveryTag, {Key, Value, PR}, Acc)
when Key > DeliveryTag ->