From 44f308fff5ee2e7ab89b38c3a0c259be8930c6e7 Mon Sep 17 00:00:00 2001 From: congqixia Date: Fri, 8 Sep 2023 18:43:16 +0800 Subject: [PATCH] Handle nil status in `merr.OK` (#26940) Signed-off-by: Congqi Xia --- pkg/util/merr/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/util/merr/utils.go b/pkg/util/merr/utils.go index 75d4b762f5..74250fc1f8 100644 --- a/pkg/util/merr/utils.go +++ b/pkg/util/merr/utils.go @@ -118,7 +118,7 @@ func oldCode(code int32) commonpb.ErrorCode { } func Ok(status *commonpb.Status) bool { - return status.ErrorCode == commonpb.ErrorCode_Success && status.Code == 0 + return status.GetErrorCode() == commonpb.ErrorCode_Success && status.GetCode() == 0 } // Error returns a error according to the given status,