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:
parent
d95f3253d4
commit
2c1f588cba
@ -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);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user