mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Cylinder model: fix an obscure case that would access cylinder -1
If we remove a cylidner for a unique gas and that is allowable, then don't try to copy from cylinder with index same_gas (which is still -1). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ce1be9c2eb
commit
c01c35ca0c
1 changed files with 3 additions and 0 deletions
|
@ -345,6 +345,9 @@ void CylindersModel::remove(const QModelIndex &index)
|
|||
}
|
||||
beginRemoveRows(QModelIndex(), index.row(), index.row()); // yah, know, ugly.
|
||||
rows--;
|
||||
// if we didn't find an identical gas, point same_gas at the index.row()
|
||||
if (same_gas == -1)
|
||||
same_gas = index.row();
|
||||
if (index.row() == 0) {
|
||||
// first gas - we need to make sure that the same gas ends up
|
||||
// as first gas
|
||||
|
|
Loading…
Reference in a new issue