From: Holger Schemel Date: Fri, 18 Feb 2022 17:28:59 +0000 (+0100) Subject: prepared some functions for empty scores list X-Git-Tag: 4.3.2.0~119 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;ds=sidebyside;h=21558e5997cd8ec09180a334aba0040ea2ca8845;p=rocksndiamonds.git prepared some functions for empty scores list --- diff --git a/src/screens.c b/src/screens.c index ba5b21c8..68b8c084 100644 --- a/src/screens.c +++ b/src/screens.c @@ -4816,7 +4816,7 @@ static void DrawChooseTree(TreeInfo **ti_ptr) if (CheckFadeAll()) fade_mask = REDRAW_ALL; - if (strEqual((*ti_ptr)->subdir, STRING_TOP_DIRECTORY)) + if (*ti_ptr != NULL && strEqual((*ti_ptr)->subdir, STRING_TOP_DIRECTORY)) { if (game_status == GAME_MODE_SETUP) { @@ -5080,7 +5080,7 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, int sx1_edit_name = getChooseTreeEditXPos(POS_LEFT); int sx2_edit_name = getChooseTreeEditXPos(POS_RIGHT); int x = 0; - int y = ti->cl_cursor; + int y = (ti != NULL ? ti->cl_cursor : 0); int step = (button == 1 ? 1 : button == 2 ? 5 : 10); int num_entries = numTreeInfoInGroup(ti); int num_page_entries = MIN(num_entries, NUM_MENU_ENTRIES_ON_SCREEN);