summaryrefslogtreecommitdiff
path: root/Libraries/LibCore
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2019-11-26 18:51:18 +0300
committerAndreas Kling <awesomekling@gmail.com>2019-11-26 19:58:25 +0100
commit2f9be662ef7b4858a08e52d3389bda9f3445e484 (patch)
tree73be05d48ad6671cf5ee5a8f6c6c45d37068b4d2 /Libraries/LibCore
parent8aef0a0755559d45ea714f58ef4ee66382a85c6c (diff)
downloadserenity-2f9be662ef7b4858a08e52d3389bda9f3445e484.zip
LibCore: Assert instead of crashing in CEventLoop::current()
Diffstat (limited to 'Libraries/LibCore')
-rw-r--r--Libraries/LibCore/CEventLoop.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Libraries/LibCore/CEventLoop.cpp b/Libraries/LibCore/CEventLoop.cpp
index 425e18a678..8019c1378a 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)