}
if (g_strcmp0(network->group, group) == 0) {
- if (group != NULL)
+ if (group != NULL && network->registered)
__connman_profile_update_network(network);
return;
}
if (network->group != NULL) {
- __connman_profile_remove_network(network);
+ if (network->registered)
+ __connman_profile_remove_network(network);
g_free(network->group);
}
network->group = g_strdup(group);
- if (network->group != NULL)
- __connman_profile_add_network(network);
+ if (network->group != NULL) {
+ if (network->registered)
+ __connman_profile_add_network(network);
+ }
}
/**
case CONNMAN_NETWORK_TYPE_WIFI:
case CONNMAN_NETWORK_TYPE_WIMAX:
if (network->group != NULL) {
- __connman_profile_remove_network(network);
+ if (network->registered)
+ __connman_profile_remove_network(network);
g_free(network->group);
network->group = NULL;