diff --git a/main/app.c b/main/app.c index 53c0d1f0fa..52536abc53 100644 --- a/main/app.c +++ b/main/app.c @@ -908,7 +908,7 @@ int ast_app_group_get_count(const char *group, const char *category) AST_RWLIST_RDLOCK(&groups); AST_RWLIST_TRAVERSE(&groups, gi, list) { - if (!strcasecmp(gi->group, group) && (ast_strlen_zero(category) || !strcasecmp(gi->category, category))) + if (!strcasecmp(gi->group, group) && (ast_strlen_zero(category) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category)))) count++; } AST_RWLIST_UNLOCK(&groups); @@ -931,7 +931,7 @@ int ast_app_group_match_get_count(const char *groupmatch, const char *category) AST_RWLIST_RDLOCK(&groups); AST_RWLIST_TRAVERSE(&groups, gi, list) { - if (!regexec(®exbuf, gi->group, 0, NULL, 0) && (ast_strlen_zero(category) || !strcasecmp(gi->category, category))) + if (!regexec(®exbuf, gi->group, 0, NULL, 0) && (ast_strlen_zero(category) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category)))) count++; } AST_RWLIST_UNLOCK(&groups);