From b57ef5d2c7a722eb20de6534ee16d1d9a88ce4b5 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 8 Mar 2017 16:23:14 -0500 Subject: db_redis: don't crash if destroying an object with no type --- modules/database/db_redis.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'modules/database/db_redis.cpp') diff --git a/modules/database/db_redis.cpp b/modules/database/db_redis.cpp index 5dfb6accf..4db4e723a 100644 --- a/modules/database/db_redis.cpp +++ b/modules/database/db_redis.cpp @@ -215,6 +215,18 @@ class DatabaseRedis : public Module, public Pipe { Serialize::Type *t = obj->GetSerializableType(); + if (t == NULL) + { + /* This is probably the module providing the type unloading. + * + * The types get registered after the extensible container is + * registered so that unserialization on module load can insert + * into the extensible container. So, the type destructs prior to + * the extensible container, which then triggers this + */ + return; + } + std::vector args; args.push_back("HGETALL"); args.push_back("hash:" + t->GetName() + ":" + stringify(obj->id)); -- cgit