We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 47c7317 commit a018168Copy full SHA for a018168
server.go
@@ -1296,7 +1296,8 @@ func (s *server) saveSnapshot() error {
1296
s.snapshot = s.pendingSnapshot
1297
1298
// Delete the previous snapshot if there is any change
1299
- if tmp != nil && !(tmp.LastIndex == s.snapshot.LastIndex && tmp.LastTerm == s.snapshot.LastTerm) {
+ currentSnapshot := s.snapshot
1300
+ if tmp != nil && currentSnapshot != nil && !(tmp.LastIndex == currentSnapshot.LastIndex && tmp.LastTerm == currentSnapshot.LastTerm) {
1301
tmp.remove()
1302
}
1303
s.pendingSnapshot = nil
0 commit comments