mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[glass] Check for null entries when updating struct/proto (#6059)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user