From 7786406e096527adafd3cce9f22f899287b5130a Mon Sep 17 00:00:00 2001 From: Carlo Field Date: Sat, 9 May 2020 21:36:37 +0200 Subject: [PATCH] add hotfix to convert in v1.0.19 --- internal/server/convert.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/server/convert.go b/internal/server/convert.go index 16fde64..2f4ebf3 100644 --- a/internal/server/convert.go +++ b/internal/server/convert.go @@ -29,13 +29,6 @@ func convertItem(c *gin.Context) { } request.Base64 = strings.TrimSpace(request.Base64) bs, err := base64.StdEncoding.DecodeString(request.Base64) - if err != nil { - log.Println(err) - c.AbortWithStatusJSON(500, err) - return - } - var dmi item.DigitalMarineItem - err = json.Unmarshal(bs, &dmi) if err != nil { // try extracting bl3 codes codes, err := extractBL3Codes(request.Base64) @@ -64,6 +57,13 @@ func convertItem(c *gin.Context) { c.JSON(200, &items) return } + var dmi item.DigitalMarineItem + err = json.Unmarshal(bs, &dmi) + if err != nil { + log.Println(err) + c.AbortWithStatusJSON(500, err) + return + } i := item.DmToGibbed(dmi) bs, err = item.Serialize(i, 0) // encrypt with 0 seed if err != nil {