Skip to content

Commit bc3fb97

Browse files
committed
only parse the hash if it’s there
Signed-off-by: Darren Kellenschwiler <[email protected]>
1 parent feacbaa commit bc3fb97

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bump.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,14 @@ func NewBUMPFromBytes(bytes []byte) (*BUMP, error) {
6464
txid := flags&2 > 0
6565
if dup {
6666
l.Duplicate = &dup
67+
} else {
68+
h := StringFromBytesReverse(bytes[skip : skip+32])
69+
l.Hash = &h
70+
skip += 32
6771
}
6872
if txid {
6973
l.Txid = &txid
7074
}
71-
h := StringFromBytesReverse(bytes[skip : skip+32])
72-
l.Hash = &h
73-
skip += 32
7475
bump.Path[lv][lf] = l
7576
}
7677
}

0 commit comments

Comments
 (0)