aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2017-11-12 04:00:56 +0000
committerRoland Knall <rknall@gmail.com>2017-11-12 09:43:37 +0000
commite95623cd6b46552eb7dd97cfbbb47292ba002fde (patch)
treec00f040ffc4fded96d6c7759d8d9f2bc562859a5
parent5bd8fb4131a92848614590fe5d7aa28fc000fdb2 (diff)
Qt: do not crash when selecting a field without tvb
If no tvb is attached to a field, crashing is not the expected result. Change-Id: Ica0e95326cfcfeb015016770d1b930a9f0447066 Fixes: v2.5.0rc0-1627-g8a6ea0e454 ("Qt: Further cleanup ByteView") Ping-Bug: 14205 Reviewed-on: https://code.wireshark.org/review/24370 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
-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 77997ea..fc58222 100644
--- a/ui/qt/utils/field_information.cpp
+++ b/ui/qt/utils/field_information.cpp
@@ -88,7 +88,7 @@ bool FieldInformation::tvbContains(FieldInformation *child)
FieldInformation::Position FieldInformation::position() const
{
Position pos = {-1, -1, -1};
- if ( fi_ )
+ if ( fi_ && fi_->ds_tvb )
{
guint len = tvb_captured_length(fi_->ds_tvb);
@@ -118,7 +118,7 @@ FieldInformation::Position FieldInformation::position() const
FieldInformation::Position FieldInformation::appendix() const
{
Position pos = {-1, -1, -1};
- if ( fi_ )
+ if ( fi_ && fi_->ds_tvb )
{
guint len = tvb_captured_length(fi_->ds_tvb);