`drawChildren` can cause a null pointer exception if the component doesn't have a focus source
kikugie opened this issue · 2 comments
BaseComponent.drawChildren()
gets the current focus handler and checks if the highlight should be drawn. However, ParentComponent.focusHandler()
allows nullable return value, so calling focusHandler.lastFocusSource()
can cause a NullPointerException
.
So uh, insert a if (focusHandler != null && ...)
While some extra assertions to clarify might certainly be of help, this is not a bug.
The only circumstance under which a component returns a null focus handler is when it's not correctly mounted - in which state it also does not support being drawn.
May I inquire how you discovered this? Likely your component was not mounted, but if we can rule that out there might be a different bug somewhere
Cheers