Skip to content

Commit

Permalink
Fix potential crash on notes selection
Browse files Browse the repository at this point in the history
  • Loading branch information
akenmorris committed Nov 9, 2023
1 parent d5cb25c commit 4a9394f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Studio/Data/DataTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,11 @@ void DataTool::table_selection_changed() {
QModelIndexList list = ui_->table->selectionModel()->selectedRows();
if (list.size() == 1) {
int row = list[0].row();
if (row >= session_->get_shapes().size()) {
ui_->subject_notes->setText("");
ui_->subject_notes->setEnabled(false);
return;
}
auto shape = session_->get_shapes()[row];
ui_->subject_notes->setText(QString::fromStdString(shape->get_subject()->get_notes()));
ui_->subject_notes->setEnabled(true);
Expand Down

0 comments on commit 4a9394f

Please sign in to comment.