From b8701ca85012bd7a64144b53288fb2bf834a9311 Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 25 Dec 2019 11:11:03 +0800 Subject: [PATCH] upc --- business/jxstore/cms/sku.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index f6a0e6c8c..4aecdb376 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -791,8 +791,10 @@ func UpdateSkuName(ctx *jxcontext.Context, nameID int, payload map[string]interf valid = utils.RemoveGeneralMapKeys(valid, model.FieldSpecQuality, model.FieldSpecUnit) _, hasPlaces := payload["places"] if len(valid) > 0 || hasPlaces { - if upc, _ := valid["Upc"].(string); upc == "" { - valid["Upc"] = nil + if valid["Upc"] != nil { + if upc, _ := valid["Upc"].(string); upc == "" { + valid["Upc"] = nil + } } globals.SugarLogger.Debugf("UpdateSkuName valid:%s", utils.Format4Output(valid, false)) // if upc, _ := valid["Upc"].(string); upc != "" {