diff --git a/lib/redis/rediswriter-objects.cpp b/lib/redis/rediswriter-objects.cpp index 5c80d1ad2..8b0e972d4 100644 --- a/lib/redis/rediswriter-objects.cpp +++ b/lib/redis/rediswriter-objects.cpp @@ -703,13 +703,15 @@ void RedisWriter::VersionChangedHandler(const ConfigObject::Ptr& object) if (object->IsActive()) { // Create or update the object config for (const RedisWriter::Ptr& rw : ConfigType::GetObjectsByType()) { - rw->m_WorkQueue.Enqueue(std::bind(&RedisWriter::SendConfigUpdate, rw, object, true)); + if (rw) + rw->m_WorkQueue.Enqueue(std::bind(&RedisWriter::SendConfigUpdate, rw, object, true)); } } else if (!object->IsActive() && object->GetExtension("ConfigObjectDeleted")) { // same as in apilistener-configsync.cpp // Delete object config for (const RedisWriter::Ptr& rw : ConfigType::GetObjectsByType()) { - rw->m_WorkQueue.Enqueue(std::bind(&RedisWriter::SendConfigDelete, rw, object)); + if (rw) + rw->m_WorkQueue.Enqueue(std::bind(&RedisWriter::SendConfigDelete, rw, object)); } } }