Check pointer before using it.

This commit is contained in:
jief 2020-03-05 09:42:50 +03:00
parent c6a59f85f9
commit f8bf956a39
2 changed files with 10 additions and 7 deletions

View File

@ -4432,7 +4432,7 @@ finish:
} }
for (i = 0; i < ThemesNum; i++) { for (i = 0; i < ThemesNum; i++) {
if (StriCmp(GlobalConfig.Theme, ThemesList[i]) == 0) { if (GlobalConfig.Theme && StriCmp(GlobalConfig.Theme, ThemesList[i]) == 0) {
OldChosenTheme = i; OldChosenTheme = i;
break; break;
} }

View File

@ -1080,11 +1080,14 @@ EFI_STATUS WaitForInputEventPoll(REFIT_MENU_SCREEN* ScreenPtr, UINTN TimeoutDefa
CheckSyncSound(); CheckSyncSound();
} }
TimeoutRemain--; TimeoutRemain--;
if ( Screen.mPointer ) {
if (Screen.mPointer->isAlive()) { if (Screen.mPointer->isAlive()) {
Screen.mPointer->UpdatePointer(); Screen.mPointer->UpdatePointer();
Status = Screen.mPointer->CheckMouseEvent(&Screen); //out: gItemID, gAction Status = Screen.mPointer->CheckMouseEvent(&Screen); //out: gItemID, gAction
if (Status != EFI_TIMEOUT) { //this check should return timeout if no mouse events occured if (Status != EFI_TIMEOUT) { //this check should return timeout if no mouse events occured
break; break;
}
} }
} }
} }