cabana: check if index is valid (#30204)

old-commit-hash: d02558c4008af9e4efc4fc36561bb5120cd47304
This commit is contained in:
Dean Lee
2023-10-07 11:13:08 +08:00
committed by GitHub
parent 38168c182c
commit 5de3198888
+2
View File
@@ -169,6 +169,8 @@ QVariant MessageListModel::headerData(int section, Qt::Orientation orientation,
}
QVariant MessageListModel::data(const QModelIndex &index, int role) const {
if (!index.isValid() || index.row() >= msgs.size()) return {};
const auto &id = msgs[index.row()];
auto &can_data = can->lastMessage(id);