From 05c98d74513f4d23eaa802664b66930b3651866a Mon Sep 17 00:00:00 2001 From: Johannes Scheuermann Date: Mon, 9 Oct 2023 18:23:42 +0200 Subject: [PATCH] Correct the way an empty result is interpreted (#1828) --- fdbclient/admin_client.go | 1 + fdbclient/fdb_client.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fdbclient/admin_client.go b/fdbclient/admin_client.go index e3a1d248b..15ac014ac 100644 --- a/fdbclient/admin_client.go +++ b/fdbclient/admin_client.go @@ -352,6 +352,7 @@ func (client *cliAdminClient) GetMaintenanceZone() (string, error) { if err != nil { return "", err } + return string(mode), nil } diff --git a/fdbclient/fdb_client.go b/fdbclient/fdb_client.go index a35079a0d..e04fac634 100644 --- a/fdbclient/fdb_client.go +++ b/fdbclient/fdb_client.go @@ -63,8 +63,9 @@ func (fdbClient *realFdbLibClient) getValueFromDBUsingKey(fdbKey string, timeout } rawResult := transaction.Get(fdb.Key(fdbKey)).MustGet() + // If the value is empty return an empty byte slice. Otherwise, an error will be thrown. if len(rawResult) == 0 { - return nil, err + return []byte{}, err } return rawResult, err