mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
git save: don't crash if the last dive isn't in a trip
The git save tries to generate a nice commit message based on the most recent dive, but stupidly didn't check whether that dive was in a trip or not, and unconditionally used the trip pointer to see if there was a trip location. Which works well enough if you always generate trips, but is an unmitigated disaster otherwise. Oops. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ed6a42f6f2
commit
3159a90b0a
1 changed files with 1 additions and 1 deletions
|
@ -850,7 +850,7 @@ static void create_commit_message(struct membuffer *msg)
|
|||
nr = dive->number;
|
||||
|
||||
put_format(msg, "dive %d: %s", nr, location);
|
||||
if (trip->location && *trip->location && strcmp(trip->location, location))
|
||||
if (trip && trip->location && *trip->location && strcmp(trip->location, location))
|
||||
put_format(msg, " (%s)", trip->location);
|
||||
put_format(msg, "\n\n");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue