mirror of
https://github.com/matrix-construct/construct
synced 2024-12-27 07:54:05 +01:00
ircd::mods: Paranoid checks after load.
This commit is contained in:
parent
fbbbb38e75
commit
c90d05a878
1 changed files with 10 additions and 3 deletions
13
ircd/mods.cc
13
ircd/mods.cc
|
@ -828,12 +828,19 @@ try
|
|||
std::make_shared<mod>(std::move(path), flags)
|
||||
};
|
||||
|
||||
assert(ret);
|
||||
assert(ret->header);
|
||||
assert(ret->header->meta);
|
||||
if(!ret || !ret->header)
|
||||
throw panic
|
||||
{
|
||||
"Unknown module error."
|
||||
};
|
||||
|
||||
// Call the user-supplied init function well after fully loading and
|
||||
// construction of the module. This way the init function sees the module
|
||||
// as loaded and can make shared_ptr references, etc.
|
||||
assert(ret->header);
|
||||
assert(ret->header->meta);
|
||||
if(ret->header->meta->init)
|
||||
if(ret->header->meta && ret->header->meta->init)
|
||||
ret->header->meta->init();
|
||||
|
||||
log::info
|
||||
|
|
Loading…
Reference in a new issue