From 870ecd5190b89c7a4e1fc9876ac306601270fdde Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 25 Aug 2021 20:01:09 +0200 Subject: [PATCH] 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. :^) --- Userland/Libraries/LibConfig/Client.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 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; }