@@ -635,17 +635,19 @@ static void service_cb(struct btd_service *service,
struct btd_profile *profile = btd_service_get_profile(service);
struct reconnect_data *reconnect;
- if (g_str_equal(profile->remote_uuid, A2DP_SINK_UUID))
- sink_cb(service, old_state, new_state);
- else if (g_str_equal(profile->remote_uuid, A2DP_SOURCE_UUID))
- source_cb(service, old_state, new_state);
- else if (g_str_equal(profile->remote_uuid, AVRCP_REMOTE_UUID))
- controller_cb(service, old_state, new_state);
- else if (g_str_equal(profile->remote_uuid, AVRCP_TARGET_UUID))
- target_cb(service, old_state, new_state);
- else if (g_str_equal(profile->remote_uuid, HFP_HS_UUID) ||
- g_str_equal(profile->remote_uuid, HSP_HS_UUID))
- hs_cb(service, old_state, new_state);
+ if (profile->remote_uuid) {
+ if (g_str_equal(profile->remote_uuid, A2DP_SINK_UUID))
+ sink_cb(service, old_state, new_state);
+ else if (g_str_equal(profile->remote_uuid, A2DP_SOURCE_UUID))
+ source_cb(service, old_state, new_state);
+ else if (g_str_equal(profile->remote_uuid, AVRCP_REMOTE_UUID))
+ controller_cb(service, old_state, new_state);
+ else if (g_str_equal(profile->remote_uuid, AVRCP_TARGET_UUID))
+ target_cb(service, old_state, new_state);
+ else if (g_str_equal(profile->remote_uuid, HFP_HS_UUID) ||
+ g_str_equal(profile->remote_uuid, HSP_HS_UUID))
+ hs_cb(service, old_state, new_state);
+ }
/*
* Return if the reconnection feature is not enabled (all
@@ -687,7 +689,7 @@ static void service_cb(struct btd_service *service,
* be the first profile that's connected so we might have an