summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibConfig
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-08-25 20:01:09 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-26 00:54:28 +0200
commit870ecd5190b89c7a4e1fc9876ac306601270fdde (patch)
treeef475c0ea9b4d132c16ebc43867b3e71ade9e393 /Userland/Libraries/LibConfig
parent67a0fa2b78fdf07c23f43ad84f95063959afda13 (diff)
downloadserenity-870ecd5190b89c7a4e1fc9876ac306601270fdde.zip
LibConfig: VERIFY that a Core::EventLoop exists before connecting
It's not possible to connect to ConfigServer without having an event loop available. This VERIFY makes it much easier to understand why things are not working. :^)
Diffstat (limited to 'Userland/Libraries/LibConfig')
-rw-r--r--Userland/Libraries/LibConfig/Client.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Libraries/LibConfig/Client.cpp b/Userland/Libraries/LibConfig/Client.cpp
index 2fce3af8dc..265c4b2e0a 100644
--- a/Userland/Libraries/LibConfig/Client.cpp
+++ b/Userland/Libraries/LibConfig/Client.cpp
@@ -12,8 +12,10 @@ static RefPtr<Client> s_the = nullptr;
Client& Client::the()
{
- if (!s_the || !s_the->is_open())
+ if (!s_the || !s_the->is_open()) {
+ VERIFY(Core::EventLoop::has_been_instantiated());
s_the = Client::construct();
+ }
return *s_the;
}