From 2fcddf1966faed6593c76b446290b92ae933116c Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Wed, 29 Sep 2021 09:14:23 +0100 Subject: [PATCH] return error if the tag is not found The previous routine cause panic if the tag is not found. Thanks for report from mzz --- app/observatory/command/command.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/observatory/command/command.go b/app/observatory/command/command.go index fe5098738..aa1962bd9 100644 --- a/app/observatory/command/command.go +++ b/app/observatory/command/command.go @@ -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) }