Merge pull request #1157 from quyuancheng/fixbug-560

Unexpected error occorred while updating http rule
This commit is contained in:
yangkaa 2022-03-31 12:06:51 +08:00 committed by GitHub
commit 57fa0beffd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -940,7 +940,7 @@ func (g *GatewayAction) SyncHTTPRules(tx *gorm.DB, components []*apimodel.Compon
httpRuleRewrites []*model.HTTPRuleRewrite
)
for _, component := range components {
if component.HTTPRules == nil {
if len(component.HTTPRules) == 0 {
continue
}
componentIDs = append(componentIDs, component.ComponentBase.ComponentID)