mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-21 09:36:34 -05:00
return error if the tag is not found
The previous routine cause panic if the tag is not found. Thanks for report from mzz
This commit is contained in:
parent
a9979057dc
commit
2fcddf1966
@ -34,7 +34,11 @@ func (s *service) GetOutboundStatus(ctx context.Context, request *GetOutboundSta
|
||||
}
|
||||
result = observeResult
|
||||
} else {
|
||||
observeResult, err := common.Must2(s.observatory.(features.TaggedFeatures).GetFeaturesByTag(request.Tag)).(extension.Observatory).GetObservation(ctx)
|
||||
fet, err := s.observatory.(features.TaggedFeatures).GetFeaturesByTag(request.Tag)
|
||||
if err != nil {
|
||||
return nil, newError("cannot get tagged observatory").Base(err)
|
||||
}
|
||||
observeResult, err := fet.(extension.Observatory).GetObservation(ctx)
|
||||
if err != nil {
|
||||
return nil, newError("cannot get observation").Base(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user