[glass] Fix handling of "/" NetworkTables key (#2991)

This commit is contained in:
Peter Johnson
2020-12-28 14:36:30 -08:00
committed by GitHub
parent 574a42f3b4
commit 1c3011ba4b

View File

@@ -190,6 +190,11 @@ void NetworkTablesModel::Update() {
parts.clear();
wpi::StringRef{entry->name}.split(parts, '/', -1, false);
// ignore a raw "/" key
if (parts.empty()) {
continue;
}
// get to leaf
auto nodes = &m_root;
for (auto part : wpi::ArrayRef(parts.begin(), parts.end()).drop_back()) {