1
0
Fork 0
forked from len0rd/rockbox

Make skinned lists handle the "0 items" case without crashing

Change-Id: Iaf69c93727e0f0e2a48b44c330883f7a620c4d99
This commit is contained in:
Frank Gevaerts 2012-02-21 01:29:12 +01:00
parent 9c21258e2c
commit 1a4da5961e

View file

@ -67,7 +67,7 @@ static int current_drawing_line;
static int offset_to_item(int offset, bool wrap) static int offset_to_item(int offset, bool wrap)
{ {
int item = current_drawing_line + offset; int item = current_drawing_line + offset;
if (!current_list) if (!current_list || current_list->nb_items == 0)
return -1; return -1;
if (item < 0) if (item < 0)
{ {