Merge "manager.c: Fixed "(null):" header in AMI AsyncAGIEnd event" into 13

certified/13.21
Jenkins2 7 years ago committed by Gerrit Code Review
commit 2bb68c707f

@ -1766,7 +1766,12 @@ void manager_json_to_ast_str(struct ast_json *obj, const char *key,
{ {
struct ast_json_iter *i; struct ast_json_iter *i;
if (!obj || (!res && !(*res) && (!(*res = ast_str_create(1024))))) { /* If obj or res is not given, just return */
if (!obj || !res) {
return;
}
if (!*res && !(*res = ast_str_create(1024))) {
return; return;
} }
@ -1797,11 +1802,14 @@ void manager_json_to_ast_str(struct ast_json *obj, const char *key,
} }
} }
struct ast_str *ast_manager_str_from_json_object(struct ast_json *blob, key_exclusion_cb exclusion_cb) struct ast_str *ast_manager_str_from_json_object(struct ast_json *blob, key_exclusion_cb exclusion_cb)
{ {
struct ast_str *res = ast_str_create(1024); struct ast_str *res = ast_str_create(1024);
if (!ast_json_is_null(blob)) {
manager_json_to_ast_str(blob, NULL, &res, exclusion_cb); manager_json_to_ast_str(blob, NULL, &res, exclusion_cb);
}
return res; return res;
} }

Loading…
Cancel
Save