mirror of
https://github.com/status-im/nim-rlp.git
synced 2025-02-10 13:06:27 +00:00
Fix assertion failure on empty byte range
This commit is contained in:
parent
d75b09795b
commit
da70fbc898
3
rlp.nim
3
rlp.nim
@ -223,9 +223,10 @@ proc toBytes*(self: Rlp): BytesRange =
|
||||
raise newException(RlpTypeMismatch,
|
||||
"Bytes expected, but the source RLP in not a blob")
|
||||
|
||||
let payloadLen = payloadBytesCount()
|
||||
if payloadLen > 0:
|
||||
let
|
||||
payloadOffset = payloadOffset()
|
||||
payloadLen = payloadBytesCount()
|
||||
ibegin = position + payloadOffset
|
||||
iend = ibegin + payloadLen - 1
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user