Fix crash on mouse scrolling before messages load
Using mouse scroll before messages load will trigger a panic as `ml.store` has not been assigned yet and is `nil`.
This commit is contained in:
parent
cb04629f3c
commit
1455ad97a9
1 changed files with 6 additions and 2 deletions
|
@ -163,10 +163,14 @@ func (ml *MessageList) MouseEvent(localX int, localY int, event tcell.Event) {
|
||||||
ml.aerc.NewTab(viewer, msg.Envelope.Subject)
|
ml.aerc.NewTab(viewer, msg.Envelope.Subject)
|
||||||
}
|
}
|
||||||
case tcell.WheelDown:
|
case tcell.WheelDown:
|
||||||
|
if ml.store != nil {
|
||||||
ml.store.Next()
|
ml.store.Next()
|
||||||
|
}
|
||||||
ml.Scroll()
|
ml.Scroll()
|
||||||
case tcell.WheelUp:
|
case tcell.WheelUp:
|
||||||
|
if ml.store != nil {
|
||||||
ml.store.Prev()
|
ml.store.Prev()
|
||||||
|
}
|
||||||
ml.Scroll()
|
ml.Scroll()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue