From 8b0cfc48437f16a3a3218199f62ee52d2f7f0832 Mon Sep 17 00:00:00 2001 From: Anshul Khandelwal <12948312+k-anshul@users.noreply.github.com> Date: Tue, 5 Mar 2024 14:40:58 +0530 Subject: [PATCH] Runtime: fixes panic in ValidateMetricsView (#4241) --- runtime/validate.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/runtime/validate.go b/runtime/validate.go index a9aab216604..b064db4f3f7 100644 --- a/runtime/validate.go +++ b/runtime/validate.go @@ -80,8 +80,7 @@ func (r *Runtime) ValidateMetricsView(ctx context.Context, instanceID string, mv f, ok := fields[strings.ToLower(mv.TimeDimension)] if !ok { res.TimeDimensionErr = fmt.Errorf("timeseries %q is not a column in table %q", mv.TimeDimension, mv.Table) - } - if f.Type.Code != runtimev1.Type_CODE_TIMESTAMP && f.Type.Code != runtimev1.Type_CODE_DATE { + } else if f.Type.Code != runtimev1.Type_CODE_TIMESTAMP && f.Type.Code != runtimev1.Type_CODE_DATE { res.TimeDimensionErr = fmt.Errorf("timeseries %q is not a TIMESTAMP column", mv.TimeDimension) } }