Bluetooth: Mesh: Fix possible NULL dereference in BT_DBG statement.

Fix possible NULL dereference in BT_DBG statement when
bt_mesh_friend_get is called before a successful cfg_srv init

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This commit is contained in:
Joakim Andersson 2020-03-05 18:32:03 +01:00 committed by Johan Hedberg
commit c97e1aafb1

View file

@ -3416,7 +3416,8 @@ u8_t bt_mesh_relay_get(void)
u8_t bt_mesh_friend_get(void)
{
BT_DBG("conf %p conf->frnd 0x%02x", conf, conf->frnd);
BT_DBG("conf %p conf->frnd 0x%02x", conf,
conf ? conf->frnd : BT_MESH_FRIEND_NOT_SUPPORTED);
if (conf) {
return conf->frnd;