diff --git a/pages.go b/pages.go index 0a5dfcf..6d0f0f5 100644 --- a/pages.go +++ b/pages.go @@ -217,6 +217,9 @@ func (p *Pages) HasFocus() bool { // Focus is called by the application when the primitive receives focus. func (p *Pages) Focus(delegate func(p Primitive)) { + if delegate == nil { + return // We cannot delegate so we cannot focus. + } p.setFocus = delegate var topItem Primitive for _, page := range p.pages {