aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2016-03-10 09:02:28 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2016-03-10 11:39:49 +0000
commite13976339be6fa8ee06177b85268d29c81dc7995 (patch)
tree015769ad524998565756a3b7cc16ce8957588d3b /ui
parentb7f6cf979c0ae5ad806d4d808b5291c6906ce866 (diff)
Qt: Check for selected interface in filterEdited()
Add a check for selected filters in filterEdited() to avoid a out-of-bounds index into ui->interfaceTree->selectedItems(). Bug: 12241 Bug: 12245 Change-Id: Ie18fc34a17427dd5330a5a617051cbc061555e0c Reviewed-on: https://code.wireshark.org/review/14404 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/capture_interfaces_dialog.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/qt/capture_interfaces_dialog.cpp b/ui/qt/capture_interfaces_dialog.cpp
index a711b8957b..9a852cc017 100644
--- a/ui/qt/capture_interfaces_dialog.cpp
+++ b/ui/qt/capture_interfaces_dialog.cpp
@@ -194,8 +194,10 @@ void CaptureInterfacesDialog::filterEdited()
ti->setText(col_filter_, ui->captureFilterComboBox->lineEdit()->text());
}
- QModelIndex col_filter_idx = ui->interfaceTree->model()->index(ui->interfaceTree->indexOfTopLevelItem(si[0]), col_filter_);
- ui->interfaceTree->scrollTo(col_filter_idx);
+ if (si.count() > 0) {
+ QModelIndex col_filter_idx = ui->interfaceTree->model()->index(ui->interfaceTree->indexOfTopLevelItem(si[0]), col_filter_);
+ ui->interfaceTree->scrollTo(col_filter_idx);
+ }
}
void CaptureInterfacesDialog::updateWidgets()