mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[ntcore] Fix string array value comparison (#5745)
It did not correctly check size prior to checking size=0.
This commit is contained in:
@@ -389,6 +389,9 @@ bool nt::operator==(const Value& lhs, const Value& rhs) {
|
||||
lhs.m_val.data.arr_double.size *
|
||||
sizeof(lhs.m_val.data.arr_double.arr[0])) == 0;
|
||||
case NT_STRING_ARRAY:
|
||||
if (lhs.m_val.data.arr_string.size != rhs.m_val.data.arr_string.size) {
|
||||
return false;
|
||||
}
|
||||
if (lhs.m_val.data.arr_string.size == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user