Skip to content

Commit

Permalink
Check if be is nil to avoid panic when be is overriden with nil by re…
Browse files Browse the repository at this point in the history
…coverSnapshotBackend on line 517

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
  • Loading branch information
serathius committed Dec 20, 2023
1 parent a2e9dc8 commit d6d263a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/etcdserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ func NewServer(cfg config.ServerConfig) (srv *EtcdServer, err error) {
}

defer func() {
if err != nil {
if be != nil && err != nil {
be.Close()
}
}()
Expand Down

0 comments on commit d6d263a

Please sign in to comment.