From a3e9fc37ba3fc01ad441ca574b1f9d66520d5ff6 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Mon, 15 May 2023 16:24:13 +0200 Subject: [PATCH] Terminal: Fix assert Trying to fetch a cell outside the valid range did trigger an assert. Change-Id: I5ac3d78aa2249d1559e7603c9e4a9bcea4d0b563 Reviewed-by: Reviewed-by: Cristian Adam --- src/plugins/terminal/celliterator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/terminal/celliterator.cpp b/src/plugins/terminal/celliterator.cpp index 597c3a632fd..d81c4b71879 100644 --- a/src/plugins/terminal/celliterator.cpp +++ b/src/plugins/terminal/celliterator.cpp @@ -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) + updateChar(); + } else if (m_pos == m_maxpos + 1) { m_state = State::END; - - updateChar(); + } } CellIterator::CellIterator(const TerminalSurface *surface)