[ntcore] Fix string array value comparison (#5745)

It did not correctly check size prior to checking size=0.
This commit is contained in:
Peter Johnson
2023-10-10 00:27:56 -07:00
committed by GitHub
parent ff1849052e
commit 1d23513945

View File

@@ -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;
}