[asterisk-commits] manager.c: Fixed "(null):" header in AMI AsyncAGIEnd event (asterisk[13])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 5 12:17:56 CST 2018


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/8151 )

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(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Sean Bright: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved
  Jenkins2: Approved for Submit



diff --git a/main/manager.c b/main/manager.c
index 4e611a0..cfe1cbf 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -1766,7 +1766,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;
 	}
 
@@ -1797,11 +1802,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/8151
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: Ice58c16361f9d9e8648261c9ed5d6c8245fb0d8f
Gerrit-Change-Number: 8151
Gerrit-PatchSet: 1
Gerrit-Owner: sungtae kim <pchero21 at gmail.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20180205/a4743e96/attachment.html>


More information about the asterisk-commits mailing list