Fix possible crash when removing constraints from table definition

This fixes a possible crash when trying to remove a table constraint
from a table definition. The issue was introduced in commit
4e1d1ff49f.

See issue #2670.
This commit is contained in:
Martin Kleusberg
2021-05-21 19:49:03 +02:00
parent d7074bb834
commit 7c1454e785
+1 -1
View File
@@ -505,7 +505,7 @@ void Table::removeConstraints(const StringVector& vStrFields, Constraint::Constr
for(auto it = m_constraints.begin();it!=m_constraints.end();)
{
if((*it)->columnList() == vStrFields && (*it)->type() == type)
m_constraints.erase(it++);
it = m_constraints.erase(it);
else
++it;
}