1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-01-19 03:57:14 +01:00

Assign the column index temporarily before validating to prevent exception if the currently assigned index is invalid.

This commit is contained in:
Sandu Liviu Catalin 2016-08-25 11:55:20 +03:00
parent d95f3253d4
commit 2c1f588cba

View File

@ -241,10 +241,12 @@ void Column::SetIndex(const Object & column)
// We don't recognize this kind of value!
default: STHROWF("Unknown column index of type (%s)", SqTypeName(column.GetType()));
}
// Assign the index with a failsafe to invalid on error
AutoAssign< Int32 > aa(m_Index, -1, idx);
// Validate the obtained column index
SQMOD_VALIDATE_COLUMN(*this, idx);
// Assign the new index
m_Index = idx;
// Don't fall back to the invalid index anymore
aa.Set(idx);
}
// ------------------------------------------------------------------------------------------------