mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-09-28 07:36:38 +08:00
fix(gost): prevent panic in service parsing with empty md
This commit is contained in:
@@ -135,7 +135,7 @@ func ParseService(cfg *config.ServiceConfig) (service.Service, error) {
|
|||||||
postDown = mdutil.GetStrings(md, parsing.MDKeyPostDown)
|
postDown = mdutil.GetStrings(md, parsing.MDKeyPostDown)
|
||||||
ignoreChain = mdutil.GetBool(md, parsing.MDKeyIgnoreChain)
|
ignoreChain = mdutil.GetBool(md, parsing.MDKeyIgnoreChain)
|
||||||
|
|
||||||
if md.IsExists(parsing.MDKeyEnableStats) {
|
if md != nil && md.IsExists(parsing.MDKeyEnableStats) {
|
||||||
enableStats = mdutil.GetBool(md, parsing.MDKeyEnableStats)
|
enableStats = mdutil.GetBool(md, parsing.MDKeyEnableStats)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ func ParseService(cfg *config.ServiceConfig) (service.Service, error) {
|
|||||||
resetTraffic := true
|
resetTraffic := true
|
||||||
if cfg.Metadata != nil {
|
if cfg.Metadata != nil {
|
||||||
md := metadata.NewMetadata(cfg.Metadata)
|
md := metadata.NewMetadata(cfg.Metadata)
|
||||||
if md.IsExists(parsing.MDKeyObserverResetTraffic) {
|
if md != nil && md.IsExists(parsing.MDKeyObserverResetTraffic) {
|
||||||
resetTraffic = mdutil.GetBool(md, parsing.MDKeyObserverResetTraffic)
|
resetTraffic = mdutil.GetBool(md, parsing.MDKeyObserverResetTraffic)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user