diff options
author | seungha.son <seungha.son@samsung.com> | 2016-11-01 13:40:37 +0900 |
---|---|---|
committer | seungha.son <seungha.son@samsung.com> | 2016-11-01 14:31:39 +0900 |
commit | 2915630b5fbef884044bf376e15fe9cb6b0f0c7d (patch) | |
tree | 6fd40acd308b2cfa0fa5dd6510616f125c35910b | |
parent | 5ef24e0b67ef879b8e7c155d2d93d9708094449b (diff) | |
download | notification-submit/tizen_3.0/20161102.051512.tar.gz notification-submit/tizen_3.0/20161102.051512.tar.bz2 notification-submit/tizen_3.0/20161102.051512.zip |
Add error handling code when row_count is zerosubmit/tizen_3.0/20161102.051512submit/tizen/20161101.004208accepted/tizen/wearable/20161101.122946accepted/tizen/tv/20161101.122923accepted/tizen/mobile/20161101.122844accepted/tizen/ivi/20161101.123005accepted/tizen/common/20161102.121412accepted/tizen/3.0/wearable/20161102.075653accepted/tizen/3.0/tv/20161102.075622accepted/tizen/3.0/mobile/20161102.075511accepted/tizen/3.0/ivi/20161102.075724
Signed-off-by: seungha.son <seungha.son@samsung.com>
Change-Id: If4f6a2f6acb841e84c1d489b22118e0043382ecb
-rw-r--r-- | src/notification_setting_service.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/notification_setting_service.c b/src/notification_setting_service.c index a4a3b50..e9adcc3 100644 --- a/src/notification_setting_service.c +++ b/src/notification_setting_service.c @@ -632,6 +632,11 @@ EXPORT_API int notification_get_dnd_and_allow_to_notify(const char *pkgname, ret = NOTIFICATION_ERROR_FROM_DB; goto out; } + if (row_count == 0) { + NOTIFICATION_ERR("Invalid uid [%d] or package name [%s]", uid, pkgname); + ret = NOTIFICATION_ERROR_INVALID_PARAMETER; + goto out; + } col_index = col_count; _get_table_field_data_int(query_setting_result, (int *)allow_to_notify, col_index++); @@ -643,6 +648,11 @@ EXPORT_API int notification_get_dnd_and_allow_to_notify(const char *pkgname, ret = NOTIFICATION_ERROR_FROM_DB; goto out; } + if (row_count == 0) { + NOTIFICATION_ERR("Invalid uid [%d]", uid); + ret = NOTIFICATION_ERROR_INVALID_PARAMETER; + goto out; + } col_index = col_count; _get_table_field_data_int(query_system_setting_result, (int *)do_not_disturb, col_index++); |