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:
parent
a9979057dc
commit
2fcddf1966
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user