diff --git a/save-git.c b/save-git.c index 3fd8807c6..2757757b2 100644 --- a/save-git.c +++ b/save-git.c @@ -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"); }