diff --git a/service/repositories/image_handle.go b/service/repositories/image_handle.go index 753fdc82..a18c70de 100644 --- a/service/repositories/image_handle.go +++ b/service/repositories/image_handle.go @@ -264,18 +264,21 @@ func (l *defaultImageHandle) LogoCombine(ctx context.Context, in *LogoCombineReq logx.Error(err) return nil, err } - if templateInfo["materialList"] == nil { + mapMaterialList, existMaterialList := templateInfo["materialList"] + if !existMaterialList { err = errors.New("materialList is null") logc.Errorf(ctx, "materialList err:%v", err) return nil, err } - materialList = templateInfo["materialList"].([]interface{}) - if templateInfo["groupOptions"] == nil { + materialList = mapMaterialList.([]interface{}) + + mapGroupOptions, existGroupOptions := templateInfo["groupOptions"] + if !existGroupOptions { err = errors.New("groupOptions is null") logc.Errorf(ctx, "groupOptions err:%v", err) return nil, err } - groupOptions = templateInfo["groupOptions"].(map[string]interface{}) + groupOptions = mapGroupOptions.(map[string]interface{}) } var moduleDataMap = make(map[string]interface{}, 4)