Skip to content

Commit

Permalink
metadium: fixed null access upon etcdPut failure
Browse files Browse the repository at this point in the history
  • Loading branch information
sadoci committed Nov 2, 2022
1 parent e18df77 commit e3b1215
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion metadium/etcdutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,11 @@ func (ma *metaAdmin) etcdPut(key, value string) (int64, error) {
ma.etcd.Server.Cfg.ReqTimeout())
defer cancel()
resp, err := ma.etcdCli.Put(ctx, key, value)
return resp.Header.Revision, err
if err == nil {
return resp.Header.Revision, err
} else {
return 0, err
}
}

func (ma *metaAdmin) etcdGet(key string) (string, error) {
Expand Down

0 comments on commit e3b1215

Please sign in to comment.