mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
Check if RedisConnection exists before checking connection
This commit is contained in:
parent
a056e14834
commit
5f64d809d7
@ -153,7 +153,7 @@ static ConfigObject::Ptr GetObjectByName(const String& name)
|
||||
// Used to update a single object, used for runtime updates
|
||||
void RedisWriter::SendConfigUpdate(const ConfigObject::Ptr& object, bool runtimeUpdate)
|
||||
{
|
||||
if (!m_Rcon->IsConnected())
|
||||
if (!m_Rcon || !m_Rcon->IsConnected())
|
||||
return;
|
||||
|
||||
String typeName = GetLowerCaseTypeNameDB(object);
|
||||
|
@ -111,7 +111,7 @@ void RedisWriter::TryToReconnect()
|
||||
else
|
||||
m_Rcon->Start();
|
||||
|
||||
if (!m_Rcon->IsConnected())
|
||||
if (!m_Rcon || !m_Rcon->IsConnected())
|
||||
return;
|
||||
|
||||
UpdateSubscriptions();
|
||||
@ -145,7 +145,7 @@ void RedisWriter::UpdateSubscriptions()
|
||||
* But since we expect and answer here and break Icinga in case of receiving no answer/an unexpected one we opt for
|
||||
* better safe than sorry here. Future implementation needs to include an improved error handling and answer verification.
|
||||
*/
|
||||
if (!m_Rcon->IsConnected())
|
||||
if (!m_Rcon || !m_Rcon->IsConnected())
|
||||
return;
|
||||
|
||||
long long cursor = 0;
|
||||
@ -220,7 +220,7 @@ void RedisWriter::PublishStats()
|
||||
{
|
||||
AssertOnWorkQueue();
|
||||
|
||||
if (!m_Rcon->IsConnected())
|
||||
if (!m_Rcon || !m_Rcon->IsConnected())
|
||||
return;
|
||||
|
||||
Dictionary::Ptr status = GetStats();
|
||||
@ -303,7 +303,7 @@ void RedisWriter::SendEvent(const Dictionary::Ptr& event)
|
||||
{
|
||||
AssertOnWorkQueue();
|
||||
|
||||
if (!m_Rcon->IsConnected())
|
||||
if (!m_Rcon || !m_Rcon->IsConnected())
|
||||
return;
|
||||
|
||||
String type = event->Get("type");
|
||||
|
Loading…
x
Reference in New Issue
Block a user