diff --git a/res/res_config_curl.c b/res/res_config_curl.c
index f80998e365debbcd508cd02b508df37d3bdf8ef8..8488d9bdc1a8776f416a7e0def273f49d7dca007 100644
--- a/res/res_config_curl.c
+++ b/res/res_config_curl.c
@@ -575,7 +575,7 @@ static struct ast_config *config_curl(const char *url, const char *unused, const
 				return NULL;
 		}
 
-		if (strcmp(category, cur_cat) || last_cat_metric != cat_metric) {
+		if (!cat || strcmp(category, cur_cat) || last_cat_metric != cat_metric) {
 			if (!(cat = ast_category_new(category, "", 99999)))
 				break;
 			cur_cat = category;