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