char **query_result = NULL;
badge_setting_h result_setting;
sqlite3 *db = NULL;
- int atd = 0;
+ int atd;
if (appid == NULL)
return BADGE_ERROR_INVALID_PARAMETER;
_get_table_field_data_string(query_result, &(result_setting[0].pkgname), 1, col_index++);
_get_table_field_data_string(query_result, &(result_setting[0].appid), 1, col_index++);
- _get_table_field_data_int(query_result, &atd, col_index++);
-
- if (atd & BAGDE_APP_DISABLE_BIT)
- result_setting[0].allow_to_display = BAGDE_NOT_ALLOW_TO_DISPLAY;
- else if (atd & BAGDE_ALLOW_TO_DISPLAY_BIT)
- result_setting[0].allow_to_display = BAGDE_ALLOW_TO_DISPLAY;
- else
+ if (_get_table_field_data_int(query_result, &atd, col_index++)) {
+ if (atd & BAGDE_APP_DISABLE_BIT)
+ result_setting[0].allow_to_display = BAGDE_NOT_ALLOW_TO_DISPLAY;
+ else if (atd & BAGDE_ALLOW_TO_DISPLAY_BIT)
+ result_setting[0].allow_to_display = BAGDE_ALLOW_TO_DISPLAY;
+ else
+ result_setting[0].allow_to_display = BAGDE_NOT_ALLOW_TO_DISPLAY;
+ } else {
result_setting[0].allow_to_display = BAGDE_NOT_ALLOW_TO_DISPLAY;
+ }
*setting = result_setting;
char *sql_query = NULL;
char **query_result = NULL;
sqlite3 *db = NULL;
- int atd = 0;
+ int atd;
if (appid == NULL)
return BADGE_ERROR_INVALID_PARAMETER;
col_index = col_count;
- _get_table_field_data_int(query_result, &atd, col_index++);
-
- if (atd & BAGDE_APP_DISABLE_BIT)
- *allow_to_display = BAGDE_NOT_ALLOW_TO_DISPLAY;
- else if (atd & BAGDE_ALLOW_TO_DISPLAY_BIT)
- *allow_to_display = BAGDE_ALLOW_TO_DISPLAY;
- else
+ if (_get_table_field_data_int(query_result, &atd, col_index++)) {
+ if (atd & BAGDE_APP_DISABLE_BIT)
+ *allow_to_display = BAGDE_NOT_ALLOW_TO_DISPLAY;
+ else if (atd & BAGDE_ALLOW_TO_DISPLAY_BIT)
+ *allow_to_display = BAGDE_ALLOW_TO_DISPLAY;
+ else
+ *allow_to_display = BAGDE_NOT_ALLOW_TO_DISPLAY;
+ } else {
*allow_to_display = BAGDE_NOT_ALLOW_TO_DISPLAY;
+ }
out:
if (query_result)