diff --git a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt index da6bce71a..d671d6bb1 100644 --- a/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt +++ b/app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageList.kt @@ -675,7 +675,7 @@ open class MessageList : override fun dispatchKeyEvent(event: KeyEvent): Boolean { var eventHandled = false - if (event.action == KeyEvent.ACTION_DOWN && searchView.isIconified) { + if (event.action == KeyEvent.ACTION_DOWN && ::searchView.isInitialized && searchView.isIconified) { eventHandled = onCustomKeyDown(event) }