Skip to content

Commit

Permalink
dict: Fix crash when no dictionaries defined
Browse files Browse the repository at this point in the history
  • Loading branch information
cmouse authored and sirainen committed May 19, 2016
1 parent f008446 commit 744fa5a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/dict/dict-connection.c
Expand Up @@ -76,6 +76,10 @@ static int dict_connection_dict_init(struct dict_connection *conn)
unsigned int i, count;
const char *uri, *error;

if (!array_is_created(&dict_settings->dicts)) {
i_error("dict client: No dictionaries configured");
return -1;
}
strlist = array_get(&dict_settings->dicts, &count);
for (i = 0; i < count; i += 2) {
if (strcmp(strlist[i], conn->name) == 0)
Expand Down

0 comments on commit 744fa5a

Please sign in to comment.