diff options
author | Donghee Ye <donghee.ye@samsung.com> | 2012-09-12 10:52:50 +0900 |
---|---|---|
committer | Donghee Ye <donghee.ye@samsung.com> | 2012-09-12 10:52:50 +0900 |
commit | b1cf31bca0b13e51a27f7cb3e431e847618308b9 (patch) | |
tree | b10a197add0f5c876002be5a349ba758d19fe41f | |
parent | e6f3d2ff9002e1cd4e1630bc10b280cb0dad424a (diff) | |
download | contacts-service-master.tar.gz contacts-service-master.tar.bz2 contacts-service-master.zip |
Fix phonelog insert error with unknown numberHEADsubmit/master/20120920.1511052.0_alphamaster2.0alpha
Change-Id: I40f6890449541f979af756ab6c4f9f4e7c7f84ea
-rwxr-xr-x | src/cts-phonelog.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/cts-phonelog.c b/src/cts-phonelog.c index 5725410..42e0412 100755 --- a/src/cts-phonelog.c +++ b/src/cts-phonelog.c @@ -124,12 +124,14 @@ static inline int cts_insert_phonelog(cts_plog *plog) stmt = cts_query_prepare(query); retvm_if(NULL == stmt, CTS_ERR_DB_FAILED, "cts_query_prepare() Failed"); - cts_stmt_bind_text(stmt, 1, plog->number); - if (plog->log_type < CTS_PLOG_TYPE_EMAIL_RECEIVED) { - ret = cts_clean_number(plog->number, clean_num, sizeof(clean_num)); - if (0 < ret) { - normal_num = cts_normalize_number(clean_num); - cts_stmt_bind_text(stmt, 2, normal_num); + if (plog->number) { + cts_stmt_bind_text(stmt, 1, plog->number); + if (plog->log_type < CTS_PLOG_TYPE_EMAIL_RECEIVED) { + ret = cts_clean_number(plog->number, clean_num, sizeof(clean_num)); + if (0 < ret) { + normal_num = cts_normalize_number(clean_num); + cts_stmt_bind_text(stmt, 2, normal_num); + } } } |