forked from qt-creator/qt-creator
Terminal: Fix assert
Trying to fetch a cell outside the valid range did trigger an assert. Change-Id: I5ac3d78aa2249d1559e7603c9e4a9bcea4d0b563 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -20,12 +20,12 @@ CellIterator::CellIterator(const TerminalSurface *surface, int pos)
|
||||
m_maxpos = surface->fullSize().width() * (surface->fullSize().height()) - 1;
|
||||
m_pos = qMax(0, qMin(m_maxpos + 1, pos));
|
||||
|
||||
if (m_pos == 0)
|
||||
if (m_pos == 0) {
|
||||
m_state = State::BEGIN;
|
||||
else if (m_pos == m_maxpos + 1)
|
||||
m_state = State::END;
|
||||
|
||||
updateChar();
|
||||
} else if (m_pos == m_maxpos + 1) {
|
||||
m_state = State::END;
|
||||
}
|
||||
}
|
||||
|
||||
CellIterator::CellIterator(const TerminalSurface *surface)
|
||||
|
Reference in New Issue
Block a user