Skip to content

Commit

Permalink
Correct the way an empty result is interpreted (#1828)
Browse files Browse the repository at this point in the history
  • Loading branch information
johscheuer authored Oct 9, 2023
1 parent 59b8d2c commit 05c98d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions fdbclient/admin_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ func (client *cliAdminClient) GetMaintenanceZone() (string, error) {
if err != nil {
return "", err
}

return string(mode), nil
}

Expand Down
3 changes: 2 additions & 1 deletion fdbclient/fdb_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 05c98d7

Please sign in to comment.