From 3e158b3e60f7d69cdf4d9c0d26a40871b4559276 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sun, 7 Jan 2024 13:59:02 -0500 Subject: [PATCH] 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. --- src/models/roomlistmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/models/roomlistmodel.cpp b/src/models/roomlistmodel.cpp index 1a58c8b49..b670b06b4 100644 --- a/src/models/roomlistmodel.cpp +++ b/src/models/roomlistmodel.cpp @@ -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;