mirror of
https://github.com/aditya-K2/gspt.git
synced 2026-01-08 21:37:58 -05:00
Check if action is nil before performing it.
This commit is contained in:
@@ -35,10 +35,13 @@ func (a *Action) SetRefreshable(r Refreshable) {
|
||||
|
||||
func (a *Action) Func() ActionFunc {
|
||||
return func(e *tcell.EventKey) *tcell.EventKey {
|
||||
val := a.f(e)
|
||||
if a.refreshable != nil && val == nil {
|
||||
a.refreshable.RefreshState()
|
||||
if a != nil && a.f != nil {
|
||||
val := a.f(e)
|
||||
if a.refreshable != nil && val == nil {
|
||||
a.refreshable.RefreshState()
|
||||
}
|
||||
return val
|
||||
}
|
||||
return val
|
||||
return e
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user