summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--epan/proto.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/epan/proto.c b/epan/proto.c
index 7dd5ccaf54..2a1d142b57 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -2443,18 +2443,11 @@ ptvcursor_add(ptvcursor_t *ptvc, int hfindex, gint length,
get_hfi_length(hfinfo, ptvc->tvb, offset, &length, &item_length);
test_length(hfinfo, ptvc->tvb, offset, item_length);
- if (!ptvc->tree) {
- ptvc->offset += get_full_length(hfinfo, ptvc->tvb, offset,
- length, item_length, encoding);
- return NULL;
- }
-
- offset = ptvc->offset;
- PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo);
- get_hfi_length(hfinfo, ptvc->tvb, offset, &length, &item_length);
ptvc->offset += get_full_length(hfinfo, ptvc->tvb, offset, length,
item_length, encoding);
+ CHECK_FOR_NULL_TREE(ptvc->tree);
+
/* Coast clear. Try and fake it */
TRY_TO_FAKE_THIS_ITEM(ptvc->tree, hfindex, hfinfo);