1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

LibCore: Log a message before failure in EventLoop::current()

If no EventLoop is present in the stack (like when you forget to create
one), a message is nicer than letting the developer go through the
stacktrace to figure out what went wrong.
This commit is contained in:
Lucas CHOLLET 2023-11-26 00:21:52 -05:00 committed by Andreas Kling
parent ca57e40350
commit 4c23f0e142

View file

@ -54,6 +54,8 @@ bool EventLoop::is_running()
EventLoop& EventLoop::current()
{
if (event_loop_stack().is_empty())
dbgln("No EventLoop is present, unable to return current one!");
return event_loop_stack().last();
}