Fix incorrect return value for ApiListener::GetInstance

refs #10711
This commit is contained in:
Gunnar Beutner 2015-11-30 15:31:11 +01:00
parent eda28b219d
commit 93834623a0
1 changed files with 5 additions and 5 deletions

View File

@ -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<X509> 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<ApiListener>::Start(runtimeCreated);
{