1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -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:
Shelikhoo 2021-09-29 09:14:23 +01:00
parent a9979057dc
commit 2fcddf1966
No known key found for this signature in database
GPG Key ID: AA7BC347968E7DB1

View File

@ -34,7 +34,11 @@ func (s *service) GetOutboundStatus(ctx context.Context, request *GetOutboundSta
} }
result = observeResult result = observeResult
} else { } 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 { if err != nil {
return nil, newError("cannot get observation").Base(err) return nil, newError("cannot get observation").Base(err)
} }