mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix potential crash when merging trips
strdup doesn't like to be passed a NULL pointer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
0f50b73f9e
commit
2c57568d56
1 changed files with 2 additions and 2 deletions
|
@ -431,9 +431,9 @@ void DiveListView::merge_trip(const QModelIndex &a, int offset)
|
|||
if (trip_a == trip_b || !trip_a || !trip_b)
|
||||
return;
|
||||
|
||||
if (!trip_a->location)
|
||||
if (!trip_a->location && trip_b->location)
|
||||
trip_a->location = strdup(trip_b->location);
|
||||
if (!trip_a->notes)
|
||||
if (!trip_a->notes && trip_b->notes)
|
||||
trip_a->notes = strdup(trip_b->notes);
|
||||
while (trip_b->dives)
|
||||
add_dive_to_trip(trip_b->dives, trip_a);
|
||||
|
|
Loading…
Add table
Reference in a new issue