mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: add check for nil options
This commit is contained in:
parent
b76f149c35
commit
61d6efda4c
@ -388,7 +388,7 @@ func (as *authStore) UserAdd(r *pb.AuthUserAddRequest) (*pb.AuthUserAddResponse,
|
|||||||
var hashed []byte
|
var hashed []byte
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
if !r.Options.NoPassword {
|
if r.Options != nil && !r.Options.NoPassword {
|
||||||
hashed, err = bcrypt.GenerateFromPassword([]byte(r.Password), as.bcryptCost)
|
hashed, err = bcrypt.GenerateFromPassword([]byte(r.Password), as.bcryptCost)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if as.lg != nil {
|
if as.lg != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user