diff options
author | Adam <Adam@anope.org> | 2017-03-08 16:23:14 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2017-03-08 16:23:30 -0500 |
commit | b57ef5d2c7a722eb20de6534ee16d1d9a88ce4b5 (patch) | |
tree | ea325c8438e38c367d9928cef4a5004dd611d8a9 | |
parent | 1a963908260519e4d3396f5655a9ffbefa2c27b2 (diff) |
db_redis: don't crash if destroying an object with no type
-rw-r--r-- | modules/database/db_redis.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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<Anope::string> args; args.push_back("HGETALL"); args.push_back("hash:" + t->GetName() + ":" + stringify(obj->id)); |