mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 09:39:10 -04:00
ble_mesh: Check if appkey exist before deleting it
This commit is contained in:
parent
4ede6c8c15
commit
d396624a60
@ -1485,7 +1485,7 @@ int bt_mesh_provisioner_local_net_key_delete(u16_t net_idx)
|
|||||||
/* Delete any app keys bound to this NetKey index */
|
/* Delete any app keys bound to this NetKey index */
|
||||||
for (j = 0; j < ARRAY_SIZE(bt_mesh.p_app_keys); j++) {
|
for (j = 0; j < ARRAY_SIZE(bt_mesh.p_app_keys); j++) {
|
||||||
struct bt_mesh_app_key *key = bt_mesh.p_app_keys[j];
|
struct bt_mesh_app_key *key = bt_mesh.p_app_keys[j];
|
||||||
if (key->net_idx == sub->net_idx) {
|
if (key && key->net_idx == sub->net_idx) {
|
||||||
bt_mesh_provisioner_local_app_key_delete(key->net_idx, key->app_idx);
|
bt_mesh_provisioner_local_app_key_delete(key->net_idx, key->app_idx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user