diff options
author | Joshua Colp <jcolp@digium.com> | 2015-02-04 00:58:34 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2015-02-04 00:58:34 +0000 |
commit | 2f2eb1931a34f29f5f0430329113fb7f5576ceea (patch) | |
tree | d7446d977690fffd4c41c54f288fb3af6e2a6788 | |
parent | f67402a52ad2b9d17754252d8de82902c1bfc760 (diff) |
sorcery: Don't try to load object types which haven't been defined.
The act of defining wizards for an object type in sorcery.conf will
create a minimal object type. This can cause a problem when a module
has multiple sorcery instances (which all get the wizards from sorcery.conf
applied) but the sorcery instances do not all contain full information
about the object types. Upon loading errors will occur stating that
the objects can not be created. This is confusing and is actually
perfectly fine.
This change makes it so that only object types which have been fully
defined will be loaded.
ASTERISK-24748 #close
Reported by: Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@431538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | main/sorcery.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/main/sorcery.c b/main/sorcery.c index 50e5e4756..17d262595 100644 --- a/main/sorcery.c +++ b/main/sorcery.c @@ -1248,6 +1248,10 @@ static int sorcery_object_load(void *obj, void *arg, int flags) struct ast_sorcery_object_type *type = obj; struct sorcery_load_details *details = arg; + if (!type->type.item_alloc) { + return 0; + } + details->type = type->name; if (details->reload && !sorcery_reloadable(details->sorcery, details->type)) { |