aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/io_graph_dialog.cpp
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-01-29 16:26:13 -0800
committerAnders Broman <a.broman58@gmail.com>2018-01-31 04:52:37 +0000
commiteda5c950b61486770ad5c3ddc78fe3860d03e8a7 (patch)
tree16bb095d117594b5a24b30462f06e924fc204fb3 /ui/qt/io_graph_dialog.cpp
parentb81c5ad26f879bc0e949a4dc42cb5e234c2ad371 (diff)
IO Graph: Add some vector checks.
Use Qvector::value in a few places instead of an array index. Change-Id: I821ef4b16df919977739c12ccaa3b9c3d53f049c Ping-bug: 14357 Reviewed-on: https://code.wireshark.org/review/25511 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'ui/qt/io_graph_dialog.cpp')
-rw-r--r--ui/qt/io_graph_dialog.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/qt/io_graph_dialog.cpp b/ui/qt/io_graph_dialog.cpp
index 749ceb2420..c974a5ea7e 100644
--- a/ui/qt/io_graph_dialog.cpp
+++ b/ui/qt/io_graph_dialog.cpp
@@ -789,14 +789,14 @@ IOGraph *IOGraphDialog::currentActiveGraph() const
{
QModelIndex index = ui->graphUat->currentIndex();
if (index.isValid()) {
- return ioGraphs_[index.row()];
+ return ioGraphs_.value(index.row(), NULL);
}
//if no currently selected item, go with first item enabled
for (int row = 0; row < uat_model_->rowCount(); row++)
{
if (graphIsEnabled(row)) {
- return ioGraphs_[row];
+ return ioGraphs_.value(row, NULL);
}
}
@@ -1171,7 +1171,7 @@ void IOGraphDialog::on_intervalComboBox_currentIndexChanged(int)
if (uat_model_ != NULL) {
for (int row = 0; row < uat_model_->rowCount(); row++) {
- IOGraph *iog = ioGraphs_[row];
+ IOGraph *iog = ioGraphs_.value(row, NULL);
if (iog) {
iog->setInterval(interval);
if (iog->visible()) {