From 3964021e9781be74db932c3ceacbb40a93c12287 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 17 May 2018 14:43:12 -0700 Subject: multi_usrp: Check for existence of mboard sensor names get_mboard_sensor_names() would crash if a USRP didn't actually have at least one sensors defined. --- host/lib/usrp/multi_usrp.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp index 9b61344ef..cdce43055 100644 --- a/host/lib/usrp/multi_usrp.cpp +++ b/host/lib/usrp/multi_usrp.cpp @@ -803,7 +803,10 @@ public: } std::vector get_mboard_sensor_names(size_t mboard){ - return _tree->list(mb_root(mboard) / "sensors"); + if (_tree->exists(mb_root(mboard) / "sensors")) { + return _tree->list(mb_root(mboard) / "sensors"); + } + return {}; } void set_user_register(const uint8_t addr, const uint32_t data, size_t mboard){ -- cgit v1.2.3