mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 06:42:16 +00:00
fix nil panic error
msg is nil and if we continue executing, we'll get nil exception at `msg.Msg.(....)`
This commit is contained in:
parent
b9afcbe3a2
commit
118b86b1ef
@ -144,8 +144,8 @@ type WALSearchOptions struct {
|
|||||||
IgnoreDataCorruptionErrors bool
|
IgnoreDataCorruptionErrors bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// SearchForEndHeight searches for the EndHeightMessage with the height and
|
// SearchForEndHeight searches for the EndHeightMessage with the given height
|
||||||
// returns an auto.GroupReader, whenever it was found or not and an error.
|
// and returns an auto.GroupReader, whenever it was found or not and an error.
|
||||||
// Group reader will be nil if found equals false.
|
// Group reader will be nil if found equals false.
|
||||||
//
|
//
|
||||||
// CONTRACT: caller must close group reader.
|
// CONTRACT: caller must close group reader.
|
||||||
@ -170,7 +170,9 @@ func (wal *baseWAL) SearchForEndHeight(height int64, options *WALSearchOptions)
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
if options.IgnoreDataCorruptionErrors && IsDataCorruptionError(err) {
|
if options.IgnoreDataCorruptionErrors && IsDataCorruptionError(err) {
|
||||||
|
wal.Logger.Debug("Corrupted entry. Skipping...", "err", err)
|
||||||
// do nothing
|
// do nothing
|
||||||
|
continue
|
||||||
} else if err != nil {
|
} else if err != nil {
|
||||||
gr.Close()
|
gr.Close()
|
||||||
return nil, false, err
|
return nil, false, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user