Fix bug in linphone_core_get_call_history_size() when no database has been set.

This commit is contained in:
Ghislain MARY 2018-02-09 16:49:15 +01:00
parent acd22269fa
commit ea11871ddb

View file

@ -610,7 +610,10 @@ int linphone_core_get_call_history_size(LinphoneCore *lc) {
sqlite3_stmt *selectStatement;
int returnValue;
if (!lc || lc->logs_db == NULL) return 0;
if (!lc)
return 0;
if (!lc->logs_db)
return (int)bctbx_list_size(lc->call_logs);
buf = sqlite3_mprintf("SELECT count(*) FROM call_history");
returnValue = sqlite3_prepare_v2(lc->logs_db, buf, -1, &selectStatement, NULL);