From a2e1dd220e031ffd91638dbcf875f71f52bbc057 Mon Sep 17 00:00:00 2001 From: Mark Michelson Date: Tue, 20 Mar 2012 21:29:00 +0000 Subject: [PATCH] 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 --- main/pbx.c | 7 +++++++ 1 file changed, 7 insertions(+) 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) -- 2.47.2