Early return on err

pull/232/head
Simon Roberts 3 years ago
parent 8ab29b3563
commit ace6d92b78
No known key found for this signature in database
GPG Key ID: 0F30F99E6B771FD4

@ -96,8 +96,9 @@ func (ct *Cointop) StatusbarMouseLeftClick() error {
// Parse the statusbar text to identify hotspots and actions
b := make([]byte, 1000)
ct.Views.Statusbar.Rewind()
if n, err := ct.Views.Statusbar.Read(b); err == nil {
if n, err := ct.Views.Statusbar.Read(b); err != nil {
return err
} else {
// Find all the "[X]word" substrings, then look for the one that was clicked
matches := regexp.MustCompile(`\[.*?\]\w+`).FindAllIndex(b[:n], -1)
for _, match := range matches {

Loading…
Cancel
Save