From 2f9be662ef7b4858a08e52d3389bda9f3445e484 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Tue, 26 Nov 2019 18:51:18 +0300 Subject: [PATCH] LibCore: Assert instead of crashing in CEventLoop::current() --- Libraries/LibCore/CEventLoop.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Libraries/LibCore/CEventLoop.cpp b/Libraries/LibCore/CEventLoop.cpp index 425e18a678c..8019c1378af 100644 --- a/Libraries/LibCore/CEventLoop.cpp +++ b/Libraries/LibCore/CEventLoop.cpp @@ -176,7 +176,9 @@ CEventLoop& CEventLoop::main() CEventLoop& CEventLoop::current() { - return *s_event_loop_stack->last(); + CEventLoop* event_loop = s_event_loop_stack->last(); + ASSERT(event_loop != nullptr); + return *event_loop; } void CEventLoop::quit(int code)