Skip to content

Commit 2d6f02d

Browse files
authored
[glass] Check for struct descriptor size 0 (#7192)
This avoids a potential divide by 0.
1 parent 96f0b24 commit 2d6f02d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

glass/src/libnt/native/cpp/NetworkTables.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ void NetworkTablesModel::ValueSource::UpdateFromValue(
745745
structName = *withoutArray;
746746
}
747747
auto desc = model.m_structDb.Find(structName);
748-
if (desc && desc->IsValid()) {
748+
if (desc && desc->IsValid() && desc->GetSize() != 0) {
749749
if (isArray) {
750750
// array of struct at top level
751751
if (valueChildrenMap) {

0 commit comments

Comments
 (0)