CELGenUserEvent: Fix error message from ast_json_pack
authorKinsey Moore <kmoore@digium.com>
Tue, 12 Nov 2013 16:34:31 +0000 (16:34 +0000)
committerKinsey Moore <kmoore@digium.com>
Tue, 12 Nov 2013 16:34:31 +0000 (16:34 +0000)
This prevents NULL from being passed into an ast_json_pack call when no
extra information is passed to the application which prevents an error
message about NULL arguments from being generated.
........

Merged revisions 402755 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@402756 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_celgenuserevent.c

index 25065dc..8717246 100644 (file)
@@ -77,7 +77,7 @@ static int celgenuserevent_exec(struct ast_channel *chan, const char *data)
 
        blob = ast_json_pack("{s: s, s: {s: s}}",
                "event", args.event,
-               "extra", "extra", args.extra);
+               "extra", "extra", S_OR(args.extra, ""));
        if (!blob) {
                return res;
        }