mirror of https://github.com/Icinga/icinga2.git
Fix: Don't activate/deactive objects when we don't have a database connection.
This commit is contained in:
parent
0829d8e17e
commit
a7548a5fae
|
@ -237,6 +237,10 @@ Dictionary::Ptr MysqlDbConnection::FetchRow(MYSQL_RES *result)
|
|||
void MysqlDbConnection::ActivateObject(const DbObject::Ptr& dbobj)
|
||||
{
|
||||
boost::mutex::scoped_lock lock(m_ConnectionMutex);
|
||||
|
||||
if (!m_Connected)
|
||||
return;
|
||||
|
||||
DbReference dbref = GetReference(dbobj);
|
||||
std::ostringstream qbuf;
|
||||
|
||||
|
@ -256,6 +260,9 @@ void MysqlDbConnection::DeactivateObject(const DbObject::Ptr& dbobj)
|
|||
{
|
||||
boost::mutex::scoped_lock lock(m_ConnectionMutex);
|
||||
|
||||
if (!m_Connected)
|
||||
return;
|
||||
|
||||
DbReference dbref = GetReference(dbobj);
|
||||
|
||||
if (!dbref.IsValid())
|
||||
|
|
Loading…
Reference in New Issue