Skip to content

Commit 15af6c3

Browse files
authored
Hitting the emergency exit (#861)
Don't change the widget state when the ID exceeds the current widget list due to pages being changed while evidence is being edited.
1 parent 7746b95 commit 15af6c3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/evidence.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,11 @@ void Courtroom::on_evidence_double_clicked(int p_id)
487487
for (AOEvidenceButton *i_button : qAsConst(ui_evidence_list))
488488
i_button->set_selected(false);
489489

490-
ui_evidence_list.at(p_id)->set_selected(true);
490+
// We have to check if the ID is on the currently displayed page.
491+
// This is because SOMEONE allowed the switching of pages while evidence is still being edited.
492+
if (p_id < ui_evidence_list.count()) {
493+
ui_evidence_list.at(p_id)->set_selected(true);
494+
}
491495
current_evidence = f_real_id;
492496

493497
evi_type f_evi = local_evidence_list.at(f_real_id);

0 commit comments

Comments
 (0)