From 351917f81715a8be275ea61d64e4f4d316a4e68a Mon Sep 17 00:00:00 2001 Message-Id: <351917f81715a8be275ea61d64e4f4d316a4e68a.1716974869.git.mdw@distorted.org.uk> From: Mark Wooding Date: Fri, 17 Aug 2007 23:24:20 +0200 Subject: [PATCH] status: assert that there are always view lines in the status view Organization: Straylight/Edgeware From: Jonas Fonseca --- tig.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tig.c b/tig.c index 6a50972..0a42ee2 100644 --- a/tig.c +++ b/tig.c @@ -3147,10 +3147,11 @@ static void status_update(struct view *view) { if (view == VIEW(REQ_VIEW_STATUS)) { - struct line *line = view->lines - ? &view->line[view->lineno] : NULL; + struct line *line = &view->line[view->lineno]; - if (!line || !line->data) { + assert(view->lines); + + if (!line->data) { report("No file has been chosen"); return; } -- [mdw]