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:
parent
ca57e40350
commit
4c23f0e142
1 changed files with 2 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue