aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/models
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2018-01-18 17:24:25 +0100
committerMichael Mann <mmann78@netscape.net>2018-01-19 16:45:27 +0000
commit804c4b1653ff8d4f8f5471aa4c6f114423ed5a66 (patch)
treef9c1177b480c42c5a744dc132508b5daa36e497a /ui/qt/models
parent24cd7a9a1fc0d5a845e99029647604877b492fdc (diff)
Qt: add sanity check in InterfaceTreeCacheModel (found by clang).
Change-Id: I8f73254d8ac4b560937431b592a81ad726ce43a9 Reviewed-on: https://code.wireshark.org/review/25370 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/qt/models')
-rw-r--r--ui/qt/models/interface_tree_cache_model.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/ui/qt/models/interface_tree_cache_model.cpp b/ui/qt/models/interface_tree_cache_model.cpp
index e193f58a9e..9fea7e9786 100644
--- a/ui/qt/models/interface_tree_cache_model.cpp
+++ b/ui/qt/models/interface_tree_cache_model.cpp
@@ -316,9 +316,7 @@ const interface_t * InterfaceTreeCacheModel::lookup(const QModelIndex &index) co
{
const interface_t * result = 0;
- if ( ! index.isValid() )
- return result;
- if ( ! global_capture_opts.all_ifaces && newDevices.size() == 0 )
+ if ( ! index.isValid() || ! global_capture_opts.all_ifaces )
return result;
int idx = index.row();