From 93834623a0c6611ed4644ad019bceac7965978de Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 30 Nov 2015 15:31:11 +0100 Subject: [PATCH] Fix incorrect return value for ApiListener::GetInstance refs #10711 --- lib/remote/apilistener.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index d0b342a75..6853f0010 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -53,6 +53,11 @@ ApiListener::ApiListener(void) void ApiListener::OnConfigLoaded(void) { + if (m_Instance) + BOOST_THROW_EXCEPTION(ScriptError("Only one ApiListener object is allowed.", GetDebugInfo())); + + m_Instance = this; + /* set up SSL context */ boost::shared_ptr cert; try { @@ -104,11 +109,6 @@ void ApiListener::Start(bool runtimeCreated) { SyncZoneDirs(); - if (m_Instance) - BOOST_THROW_EXCEPTION(ScriptError("Only one ApiListener object is allowed.", GetDebugInfo())); - - m_Instance = this; - ObjectImpl::Start(runtimeCreated); { -- 2.40.0