mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-01-19 12:07:13 +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!
|
// We don't recognize this kind of value!
|
||||||
default: STHROWF("Unknown column index of type (%s)", SqTypeName(column.GetType()));
|
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
|
// Validate the obtained column index
|
||||||
SQMOD_VALIDATE_COLUMN(*this, idx);
|
SQMOD_VALIDATE_COLUMN(*this, idx);
|
||||||
// Assign the new index
|
// Don't fall back to the invalid index anymore
|
||||||
m_Index = idx;
|
aa.Set(idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user