Stop log spam because subtitleText was called without a valid event

It's up to the call site to check if the event is valid before calling
this function, and it prevents tons of log spam because we didn't check
yet.
This commit is contained in:
Joshua Goins
2024-01-07 13:59:02 -05:00
parent b9ec33dd94
commit 3e158b3e60

View File

@@ -349,7 +349,7 @@ QVariant RoomListModel::data(const QModelIndex &index, int role) const
return m_categoryVisibility.value(data(index, CategoryRole).toInt(), true);
}
if (role == SubtitleTextRole) {
if (room->lastEventIsSpoiler()) {
if (room->lastEvent() == nullptr || room->lastEventIsSpoiler()) {
return QString();
}
EventHandler eventHandler;