]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix one more "(null)" string.
authorMark Michelson <mmichelson@digium.com>
Tue, 20 Mar 2012 21:29:00 +0000 (21:29 +0000)
committerMark Michelson <mmichelson@digium.com>
Tue, 20 Mar 2012 21:29:00 +0000 (21:29 +0000)
If a hint with no presence portion were added, it would
result in another "(null)" string warning.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@360071 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/pbx.c

index c3880db031215628565e0e6cb6c8d37bca82b245..913508965d91115401f9d429033b2a07406436fe 100644 (file)
@@ -4361,6 +4361,8 @@ static char *parse_hint_presence(struct ast_str *hint_args)
        if ((tmp = strrchr(copy, ','))) {
                *tmp = '\0';
                tmp++;
+       } else {
+               return NULL;
        }
        ast_str_set(&hint_args, 0, "%s", tmp);
        return ast_str_buffer(hint_args);
@@ -4465,6 +4467,11 @@ static int extension_presence_state_helper(struct ast_exten *e, char **subtype,
        ast_str_set(&hint_app, 0, "%s", app);
        presence_provider = parse_hint_presence(hint_app);
 
+       if (ast_strlen_zero(presence_provider)) {
+               /* No presence string in the hint */
+               return 0;
+       }
+
        return ast_presence_state(presence_provider, subtype, message);
 }
 int ast_hint_presence_state(struct ast_channel *c, const char *context, const char *exten, char **subtype, char **message)