Skip to content

Commit

Permalink
htable: check if entries are initialized before sync'ing to db
Browse files Browse the repository at this point in the history
(cherry picked from commit 9a8974a)
  • Loading branch information
miconda committed May 5, 2022
1 parent 02b0340 commit b8ad927
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/modules/htable/ht_db.c
Expand Up @@ -551,6 +551,11 @@ int ht_db_save_table(ht_t *ht, str *dbtable)
time_t now;
int ncols;

if(ht==NULL || ht->entries==NULL) {
LM_DBG("hash table not initialized yet\n");
return -1;
}

if(ht_db_con==NULL)
{
LM_ERR("no db connection\n");
Expand Down

0 comments on commit b8ad927

Please sign in to comment.