aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorTomasz Moń <desowin@gmail.com>2019-08-13 15:19:04 +0200
committerStig Bjørlykke <stig@bjorlykke.org>2019-08-13 13:46:01 +0000
commit9784b1dda1123deba011f91a4c6bbb7f55c8a7d1 (patch)
tree3d26b65ddacc9a12f358c5ac209730a29b27ba0a /ui
parent83bdc68c96642b5ed3d484d209a4f112c5c16013 (diff)
Qt: Fix importProfilesFromDir() semantics
The default value for skippedCnt is Q_NULLPTR. Do not dereference skippedCnt unconditionally. Change-Id: Ice33a7f9034507f39f16406cc365f39f4e543da5 Reviewed-on: https://code.wireshark.org/review/34271 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/models/profile_model.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/qt/models/profile_model.cpp b/ui/qt/models/profile_model.cpp
index f522e183aa..979f0ae38b 100644
--- a/ui/qt/models/profile_model.cpp
+++ b/ui/qt/models/profile_model.cpp
@@ -1129,7 +1129,7 @@ int ProfileModel::importProfilesFromDir(QString dirname, int * skippedCnt, bool
QDir profileDir(gchar_free_to_qstring(get_profiles_dir()));
QDir dir(dirname);
- if ( *skippedCnt)
+ if ( skippedCnt )
*skippedCnt = 0;
if ( dir.exists() )
@@ -1178,7 +1178,8 @@ int ProfileModel::importProfilesFromDir(QString dirname, int * skippedCnt, bool
loadProfiles();
}
- *skippedCnt = skipped;
+ if ( skippedCnt )
+ *skippedCnt = skipped;
return count;
}