aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_groupcount.c
diff options
context:
space:
mode:
Diffstat (limited to 'funcs/func_groupcount.c')
-rwxr-xr-xfuncs/func_groupcount.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/funcs/func_groupcount.c b/funcs/func_groupcount.c
index 292364a46..66a7367ac 100755
--- a/funcs/func_groupcount.c
+++ b/funcs/func_groupcount.c
@@ -33,8 +33,10 @@ static char *group_count_function_read(struct ast_channel *chan, char *cmd, char
ast_app_group_split_group(data, group, sizeof(group), category, sizeof(category));
if (ast_strlen_zero(group)) {
- grp = pbx_builtin_getvar_helper(chan, category);
- ast_copy_string(group, grp, sizeof(group));
+ if ((grp = pbx_builtin_getvar_helper(chan, category)))
+ ast_copy_string(group, grp, sizeof(group));
+ else
+ return buf;
}
count = ast_app_group_get_count(group, category);