mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 08:40:16 +00:00
Return NULL when no results returned for realtime_multientry
It was not documented what the return value should be when no entries were returned with the multientry realtime callback. This change forces consistent behavior even if the backends return an empty ast_config. Review: https://reviewboard.asterisk.org/r/1521/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@342223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2446,6 +2446,11 @@ struct ast_config *ast_load_realtime_multientry(const char *family, ...)
|
||||
for (i = 1; ; i++) {
|
||||
if ((eng = find_engine(family, i, db, sizeof(db), table, sizeof(table)))) {
|
||||
if (eng->realtime_multi_func && (res = eng->realtime_multi_func(db, table, ap))) {
|
||||
/* If we were returned an empty cfg, destroy it and return NULL */
|
||||
if (!res->root) {
|
||||
ast_config_destroy(res);
|
||||
res = NULL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user