aboutsummaryrefslogtreecommitdiffstats
path: root/profile-widget/diverectitem.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-08-12 08:26:08 +0200
committerGravatar bstoeger <32835590+bstoeger@users.noreply.github.com>2021-08-12 20:57:26 +0200
commit67769235e78e7963a093bcf84e3b27ad1a0b8d6c (patch)
tree5f62fd70d36e5cd560d4671b24ad41554eece99b /profile-widget/diverectitem.cpp
parentf308a6b57be0a79bef93d8b088dca1c2baf9f105 (diff)
downloadsubsurface-67769235e78e7963a093bcf84e3b27ad1a0b8d6c.tar.gz
desktop: fix crash when right-clicking of trip headers
Commit e42fc1a1e9a13c77d3474dbcb26b68b8772b8c6d introduced a crash condition. Apparently the code attempts to test whether the clicked-on item is a top-level dive. The "Collapse others" menu item should not be shown in that case. It does this by testing "d->divetrip". However, "d" might quite logically be null if clicking on an unexpanded trip header. Therefore, check explicitly for the trip header case (which should show the menu item) and for good measure prevent the nullpointer access (that should be caught by testing for trip, but who knows). Fixes #3301. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/diverectitem.cpp')
0 files changed, 0 insertions, 0 deletions