[glass] Check for null entries when updating struct/proto (#6059)

This commit is contained in:
Peter Johnson
2023-12-18 11:31:08 -08:00
committed by GitHub
parent a004c9e05f
commit f02984159f

View File

@@ -879,7 +879,10 @@ void NetworkTablesModel::Update() {
} else if (desc->IsValid()) {
// loop over all entries with this type and update
for (auto&& entryPair : m_entries) {
auto ts = entryPair.second->info.type_str;
if (!entryPair.second) {
continue;
}
std::string_view ts = entryPair.second->info.type_str;
if (!wpi::starts_with(ts, "struct:")) {
continue;
}
@@ -901,7 +904,10 @@ void NetworkTablesModel::Update() {
} else {
// loop over all protobuf entries and update (conservatively)
for (auto&& entryPair : m_entries) {
auto& ts = entryPair.second->info.type_str;
if (!entryPair.second) {
continue;
}
std::string_view ts = entryPair.second->info.type_str;
if (wpi::starts_with(ts, "proto:")) {
entryPair.second->UpdateFromValue(*this);
}