[glass] Check for struct descriptor size 0 (#7192)

This avoids a potential divide by 0.
This commit is contained in:
Peter Johnson
2024-10-11 16:09:32 -07:00
committed by GitHub
parent 96f0b2482c
commit 2d6f02d15b

View File

@@ -745,7 +745,7 @@ void NetworkTablesModel::ValueSource::UpdateFromValue(
structName = *withoutArray;
}
auto desc = model.m_structDb.Find(structName);
if (desc && desc->IsValid()) {
if (desc && desc->IsValid() && desc->GetSize() != 0) {
if (isArray) {
// array of struct at top level
if (valueChildrenMap) {