[Asterisk-code-review] manager.c: Fixed "(null):" header in AMI AsyncAGIEnd event (asterisk[13.19])
sungtae kim
asteriskteam at digium.com
Fri Feb 2 06:14:24 CST 2018
sungtae kim has uploaded this change for review. ( https://gerrit.asterisk.org/8149
Change subject: manager.c: Fixed "(null):" header in AMI AsyncAGIEnd event
......................................................................
manager.c: Fixed "(null):" header in AMI AsyncAGIEnd event
* Changed to create ami_event string only when the given blob is not
json_null().
* Fixed bad expression.
ASTERISK-27621
Change-Id: Ice58c16361f9d9e8648261c9ed5d6c8245fb0d8f
---
M main/manager.c
1 file changed, 11 insertions(+), 3 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/49/8149/1
diff --git a/main/manager.c b/main/manager.c
index 890a975..1eef2f1 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -1764,7 +1764,12 @@
{
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;
}
@@ -1795,11 +1800,14 @@
}
}
-
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);
- manager_json_to_ast_str(blob, NULL, &res, exclusion_cb);
+
+ if (!ast_json_is_null(blob)) {
+ manager_json_to_ast_str(blob, NULL, &res, exclusion_cb);
+ }
+
return res;
}
--
To view, visit https://gerrit.asterisk.org/8149
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13.19
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice58c16361f9d9e8648261c9ed5d6c8245fb0d8f
Gerrit-Change-Number: 8149
Gerrit-PatchSet: 1
Gerrit-Owner: sungtae kim <pchero21 at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180202/20ee7b72/attachment.html>
More information about the asterisk-code-review
mailing list