maps_place_category_destroy(category);
}
- if (categoryId)
- place_req->categories = g_strdup_printf("%s", categoryId);
+ if (categoryId) {
+ if (strlen(categoryId) == 0) {
+ place_req->categories = NULL;
+ } else {
+ place_req->categories = g_strdup_printf("%s", categoryId);
+ }
+ }
if (searchKeyword)
place_req->search_string = g_strdup_printf("%s", searchKeyword);
- if (!searchKeyword && !categoryId) {
- g_free(calldata_place);
- calldata_place = NULL;
- g_free(place_req);
- place_req = NULL;
- return MAPS_ERROR_INVALID_PARAMETER;
- }
-
if (searchKeyword) {
g_free(searchKeyword);
searchKeyword = NULL;
maps_place_category_destroy(category);
}
- if (categoryId)
- place_req->categories = g_strdup_printf("%s", categoryId);
+ if (categoryId) {
+ if (strlen(categoryId) == 0) {
+ place_req->categories = NULL;
+ } else {
+ place_req->categories = g_strdup_printf("%s", categoryId);
+ }
+ }
if (searchKeyword)
place_req->search_string = g_strdup_printf("%s", searchKeyword);
- if (!searchKeyword && !categoryId) {
- g_free(calldata_place);
- calldata_place = NULL;
- g_free(place_req);
- place_req = NULL;
- return MAPS_ERROR_INVALID_PARAMETER;
- }
-
if (searchKeyword) {
g_free(searchKeyword);
searchKeyword = NULL;