tog: exit loop if show_commit() returns an error
diff --git a/tog/tog.c b/tog/tog.c
index 490cb45..d439851 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -707,7 +707,7 @@ show_log_view(struct got_object_id *start_id, struct got_repository *repo)
case '\r':
err = show_commit(selected_entry, repo);
if (err)
- break;
+ goto done;
show_panel(tog_log_view.panel);
break;
default: