Fixes a crash when pressing Home/End/PgUp/PgDown in a user map directory with no maps.

git-svn-id: https://svn.eduke32.com/eduke32@671 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
plagman 2008-03-30 15:39:22 +00:00
parent d576ee5c40
commit e59df55f41
1 changed files with 2 additions and 2 deletions

View File

@ -2194,7 +2194,7 @@ cheat_for_port_credits:
CACHE1D_FIND_REC *seeker = currentlist ? findfiles : finddirs;
if ((KB_KeyPressed(sc_Home)|KB_KeyPressed(sc_End)) > 0)
{
while (KB_KeyPressed(sc_End)?seeker->next:seeker->prev)
while (seeker && (KB_KeyPressed(sc_End)?seeker->next:seeker->prev))
seeker = KB_KeyPressed(sc_End)?seeker->next:seeker->prev;
if (seeker)
{
@ -2209,7 +2209,7 @@ cheat_for_port_credits:
i = 6;
while (i>0)
{
if (KB_KeyPressed(sc_PgDn)?seeker->next:seeker->prev)
if (seeker && (KB_KeyPressed(sc_PgDn)?seeker->next:seeker->prev))
seeker = KB_KeyPressed(sc_PgDn)?seeker->next:seeker->prev;
i--;
}