From 823e0906da615865f666b3f7911ed14f90bcf38a Mon Sep 17 00:00:00 2001 From: ArthurSonzogni Date: Mon, 25 May 2020 01:35:22 +0200 Subject: [PATCH] Fix OnEvent being called on Empty containers. --- src/ftxui/component/container.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ftxui/component/container.cpp b/src/ftxui/component/container.cpp index 1fdb47e..3e05245 100644 --- a/src/ftxui/component/container.cpp +++ b/src/ftxui/component/container.cpp @@ -37,7 +37,7 @@ bool Container::OnEvent(Event event) { if (!Focused()) return false; - if (ActiveChild()->OnEvent(event)) + if (ActiveChild() && ActiveChild()->OnEvent(event)) return true; return (this->*event_handler_)(event);