[#135] sdk/container: Fix IDFromV2 nil-behavior

Remove nil if-statement from IDFromV2 function to which avoids checking the
correctness of the identifier format. From now IDFromV2 returns format error
on nil argument.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-09-04 12:17:19 +03:00 committed by Stanislav Bogatyrev
parent 047bae63d0
commit 8e9d456038

View file

@ -33,10 +33,6 @@ func (id *ID) ToV2() *refs.ContainerID {
}
func IDFromV2(idV2 *refs.ContainerID) (*ID, error) {
if idV2 == nil {
return nil, nil
}
val := idV2.GetValue()
if ln := len(val); ln != sha256.Size {
return nil, errors.Errorf(