From: Mark Michelson Date: Tue, 20 Mar 2012 21:29:00 +0000 (+0000) Subject: Fix one more "(null)" string. X-Git-Tag: certified/1.8.11-cert1~3^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2e1dd220e031ffd91638dbcf875f71f52bbc057;p=thirdparty%2Fasterisk.git Fix one more "(null)" string. 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 --- diff --git a/main/pbx.c b/main/pbx.c index c3880db031..913508965d 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -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)