Skip to content

Commit

Permalink
only parse the hash if it’s there
Browse files Browse the repository at this point in the history
Signed-off-by: Darren Kellenschwiler <[email protected]>
  • Loading branch information
sirdeggen committed Nov 20, 2023
1 parent feacbaa commit bc3fb97
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bump.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@ func NewBUMPFromBytes(bytes []byte) (*BUMP, error) {
txid := flags&2 > 0
if dup {
l.Duplicate = &dup
} else {
h := StringFromBytesReverse(bytes[skip : skip+32])
l.Hash = &h
skip += 32
}
if txid {
l.Txid = &txid
}
h := StringFromBytesReverse(bytes[skip : skip+32])
l.Hash = &h
skip += 32
bump.Path[lv][lf] = l
}
}
Expand Down

0 comments on commit bc3fb97

Please sign in to comment.