cabana: check if index is valid (#30204)

pull/30206/head
Dean Lee 2 years ago committed by GitHub
parent 1abea5a259
commit d02558c400
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      tools/cabana/messageswidget.cc

@ -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);

Loading…
Cancel
Save