Commit 520426b0547120abac809e7dd56d94e088d56a60

Stefan Sperling 2018-05-08T09:08:27

fix error handling case in tog(1)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/tog/tog.c b/tog/tog.c
index a7e3024..730c010 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -435,8 +435,10 @@ show_log_view(struct got_object_id *start_id, struct got_repository *repo)
 				}
 				got_object_close(obj);
 				err = got_object_open(&obj, repo, id);
-				if (err)
-					return err;
+				if (err) {
+					obj = NULL;
+					goto done;
+				}
 				if (got_object_get_type(obj) !=
 				    GOT_OBJ_TYPE_COMMIT) {
 					err = got_error(GOT_ERR_OBJ_TYPE);