MessageContentModel: Guard data() against being called when there is no room
This commit is contained in:
@@ -118,6 +118,11 @@ QVariant MessageContentModel::data(const QModelIndex &index, int role) const
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!m_room) {
|
||||||
|
qWarning() << "MessageContentModel::data called without room";
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
const auto component = m_components[index.row()];
|
const auto component = m_components[index.row()];
|
||||||
|
|
||||||
if (role == DisplayRole) {
|
if (role == DisplayRole) {
|
||||||
|
|||||||
Reference in New Issue
Block a user