MessageContentModel: Guard data() against being called when there is no room

This commit is contained in:
Tobias Fella
2025-10-01 23:48:49 +02:00
parent a2fc00365e
commit cfc7f50a1f

View File

@@ -118,6 +118,11 @@ QVariant MessageContentModel::data(const QModelIndex &index, int role) const
return {};
}
if (!m_room) {
qWarning() << "MessageContentModel::data called without room";
return {};
}
const auto component = m_components[index.row()];
if (role == DisplayRole) {