summaryrefslogtreecommitdiff
path: root/src/notification_noti.c
diff options
context:
space:
mode:
authorMyungki Lee <mk5004.lee@samsung.com>2016-08-30 09:52:55 +0900
committerMyungki Lee <mk5004.lee@samsung.com>2016-08-30 09:52:55 +0900
commitbc66d7131824c504ebdc0b7c753494b3e5034358 (patch)
tree151ce171d34e5cd41b559dbdd73f84dc7186e896 /src/notification_noti.c
parente3a082a77560cd4d8277062c38a467a18b9ae2a2 (diff)
downloadnotification-bc66d7131824c504ebdc0b7c753494b3e5034358.tar.gz
notification-bc66d7131824c504ebdc0b7c753494b3e5034358.tar.bz2
notification-bc66d7131824c504ebdc0b7c753494b3e5034358.zip
Add exception in case pkgname is null
- GLib-CRITICAL **: g_variant_new_string: assertion 'string != NULL' failed Change-Id: I65a99c0c3031abd9dc9477adc78b0ba02d681d06 Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
Diffstat (limited to 'src/notification_noti.c')
-rwxr-xr-xsrc/notification_noti.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/notification_noti.c b/src/notification_noti.c
index e413268..114b893 100755
--- a/src/notification_noti.c
+++ b/src/notification_noti.c
@@ -1367,17 +1367,18 @@ EXPORT_API int notification_noti_delete_by_priv_id_get_changes(const char *pkgna
char query[NOTIFICATION_QUERY_MAX] = {0, };
int ret;
- if (pkgname == NULL || strlen(pkgname) == 0)
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
-
db = notification_db_open(DBPATH);
if (!db)
return get_last_result();
- snprintf(query, sizeof(query), "delete from noti_list "
- "where caller_pkgname = '%s' and priv_id = %d and uid = %d", pkgname,
- priv_id, uid);
- NOTIFICATION_DBG("%s", query);
+ if (pkgname == NULL || strlen(pkgname) == 0) {
+ snprintf(query, sizeof(query), "delete from noti_list "
+ "where priv_id = %d and uid = %d", priv_id, uid);
+ } else {
+ snprintf(query, sizeof(query), "delete from noti_list "
+ "where caller_pkgname = '%s' and priv_id = %d and uid = %d",
+ pkgname, priv_id, uid);
+ }
ret = notification_db_exec(db, query, num_changes);