aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/utils
diff options
context:
space:
mode:
authorMartin Boye Petersen <martinboyepetersen@gmail.com>2018-09-07 09:29:39 +0200
committerStig Bjørlykke <stig@bjorlykke.org>2018-09-07 08:33:51 +0000
commit7b37c5c180eff710c49ee324869c9ad4dc5c7262 (patch)
tree5fdab2d6297115991a711515c2cea655a37695db /ui/qt/utils
parent04ef87a7b8b0b9d4e95250190247ddd9a4b259ab (diff)
Qt: Add null check for finfo and hfinfo
Adding the null check fixes a bug that made wireshark crash when right clicking a subtree which doesn't have any preferences and if none of the parents had one either. The problem was introduced in commit 589413d8772f1450be9bd4a2550cb99a95f71299 Change-Id: Ia5bbae0a58298f3e9d912e44f33589da1cbfacc9 Reviewed-on: https://code.wireshark.org/review/29455 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'ui/qt/utils')
-rw-r--r--ui/qt/utils/field_information.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/qt/utils/field_information.cpp b/ui/qt/utils/field_information.cpp
index d671106cf7..876f8bdb6f 100644
--- a/ui/qt/utils/field_information.cpp
+++ b/ui/qt/utils/field_information.cpp
@@ -15,7 +15,7 @@ FieldInformation::FieldInformation(field_info *fi, QObject * parent)
:QObject(parent)
{
fi_ = fi;
- parent_fi_ = 0;
+ parent_fi_ = NULL;
}
FieldInformation::FieldInformation(proto_node *node, QObject * parent)
@@ -34,7 +34,7 @@ bool FieldInformation::isValid() const
if ( fi_ && fi_->hfinfo )
{
- if (fi_->hfinfo->blurb != 0 && fi_->hfinfo->blurb[0] != '\0') {
+ if (fi_->hfinfo->blurb != NULL && fi_->hfinfo->blurb[0] != '\0') {
ret = true;
} else {
ret = QString((fi_->hfinfo->name)).length() > 0;