LOCATIONS_NULL_ARG_CHECK(manager);
LOCATIONS_NULL_ARG_CHECK(callback);
location_manager_s *handle = (location_manager_s *) manager;
- handle->user_cb[type] = callback;
- handle->user_data[type] = user_data;
+ if (handle != NULL){
+ handle->user_cb[type] = callback;
+ handle->user_data[type] = user_data;
+ }
+ else
+ LOCATIONS_LOGE("Null Handle");
LOCATIONS_LOGD("event type : %d", type);
return LOCATIONS_ERROR_NONE;
}
{
LOCATIONS_NULL_ARG_CHECK(manager);
location_manager_s *handle = (location_manager_s *) manager;
- handle->user_cb[type] = NULL;
- handle->user_data[type] = NULL;
+ if (handle != NULL){
+ handle->user_cb[type] = NULL;
+ handle->user_data[type] = NULL;
+ }
+ else
+ LOCATIONS_LOGE("Null Handle");
LOCATIONS_LOGD("event type : %d", type);
return LOCATIONS_ERROR_NONE;
}
return __convert_error_code(ret); //LCOV_EXCL_LINE
free(handle);
+ handle = NULL;
return LOCATIONS_ERROR_NONE;
}
location_manager_s *handle = (location_manager_s *) manager;
LocationMethod _method = LOCATION_METHOD_NONE;
- g_object_get(handle->object, "method", &_method, NULL);
+ if (handle != NULL)
+ g_object_get(handle->object, "method", &_method, NULL);
+ else
+ LOCATIONS_LOGE("Null Handle");
switch (_method) {
case LOCATION_METHOD_NONE:
*method = LOCATIONS_METHOD_NONE;
LocationPosition *last_pos = NULL;
LocationVelocity *last_vel = NULL;
LocationAccuracy *last_acc = NULL;
- ret = location_get_last_position_ext(handle->object, &last_pos, &last_vel, &last_acc);
+ if (handle != NULL)
+ ret = location_get_last_position_ext(handle->object, &last_pos, &last_vel, &last_acc);
+ else
+ LOCATIONS_LOGE("Null Handle");
if (ret != LOCATION_ERROR_NONE)
return __convert_error_code(ret); //LCOV_EXCL_LINE
LOCATIONS_CHECK_CONDITION(interval >= 1 && interval <= 120, LOCATIONS_ERROR_INVALID_PARAMETER, "LOCATIONS_ERROR_INVALID_PARAMETER");
LOCATIONS_NULL_ARG_CHECK(manager);
location_manager_s *handle = (location_manager_s *) manager;
- g_object_set(handle->object, "loc-interval", interval, NULL);
+ if (handle != NULL)
+ g_object_set(handle->object, "loc-interval", interval, NULL);
+ else
+ LOCATIONS_LOGE("Null Handle");
return __set_callback(_LOCATIONS_EVENT_TYPE_POS_VEL, manager, callback, user_data);
}
LOCATIONS_NULL_ARG_CHECK(nmea);
location_manager_s *handle = (location_manager_s *) manager;
char *nmea_data;
-
- int ret = location_get_nmea(handle->object, &nmea_data);
+ int ret = 0;
+ if (handle != NULL)
+ ret = location_get_nmea(handle->object, &nmea_data);
+ else
+ LOCATIONS_LOGE("Null Handle");
if (ret != LOCATION_ERROR_NONE || nmea == NULL) {
//LCOV_EXCL_START
if (ret == LOCATION_ERROR_NOT_ALLOWED) {