Fix GetVersion

This commit is contained in:
Thomas LAY
2020-05-05 16:11:16 +02:00
parent cf02b3ef5c
commit 3ac524b657
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -18,7 +18,12 @@ func GetVersion(s string) (version TcfVersion, err error) {
}
}()
b, err := base64.RawURLEncoding.DecodeString(s)
segments := strings.Split(s, ".")
if len(segments) == 0 {
return TcfVersionUndefined, err
}
b, err := base64.RawURLEncoding.DecodeString(segments[0])
if err != nil {
return TcfVersionUndefined, err
}