Assert that index is valid
This commit is contained in:
committed by
Tobias Fella
parent
b254b4aa9b
commit
c7caec894e
@@ -462,6 +462,7 @@ static LinkPreviewer *emptyLinkPreview = new LinkPreviewer;
|
|||||||
|
|
||||||
QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
|
QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
|
||||||
{
|
{
|
||||||
|
Q_ASSERT(checkIndex(idx, QAbstractItemModel::CheckIndexOption::IndexIsValid));
|
||||||
const auto row = idx.row();
|
const auto row = idx.row();
|
||||||
|
|
||||||
if (!m_currentRoom || row < 0 || row >= int(m_currentRoom->pendingEvents().size()) + m_currentRoom->timelineSize()) {
|
if (!m_currentRoom || row < 0 || row >= int(m_currentRoom->pendingEvents().size()) + m_currentRoom->timelineSize()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user