From 1a4da5961ed5f7d4699ce6a5712bea1ab43da203 Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Tue, 21 Feb 2012 01:29:12 +0100 Subject: Make skinned lists handle the "0 items" case without crashing Change-Id: Iaf69c93727e0f0e2a48b44c330883f7a620c4d99 --- apps/gui/bitmap/list-skinned.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/gui/bitmap/list-skinned.c b/apps/gui/bitmap/list-skinned.c index f1398a561f..672a1e90e3 100644 --- a/apps/gui/bitmap/list-skinned.c +++ b/apps/gui/bitmap/list-skinned.c @@ -67,7 +67,7 @@ static int current_drawing_line; static int offset_to_item(int offset, bool wrap) { int item = current_drawing_line + offset; - if (!current_list) + if (!current_list || current_list->nb_items == 0) return -1; if (item < 0) { -- cgit v1.2.3