screen_blanker: Check if be_app is NULL

... before using it after dynamic_cast. Fixes CID 1130496
This commit is contained in:
John Scipione
2013-11-20 19:04:14 -05:00
parent 1eb5facaf4
commit 22d7435282
+9 -7
View File
@@ -57,13 +57,15 @@ ScreenSaverFilter::Filter(BMessage* message, BHandler** target)
be_app->PostMessage(B_QUIT_REQUESTED); be_app->PostMessage(B_QUIT_REQUESTED);
break; break;
} }
} else if (message->what == B_KEY_DOWN } else if (message->what == B_KEY_DOWN) {
&& dynamic_cast<ScreenBlanker*>(be_app)->IsPasswordWindowShown()) { ScreenBlanker* app = dynamic_cast<ScreenBlanker*>(be_app);
// Handle the escape key when the password window is showing if (app != NULL && app->IsPasswordWindowShown()) {
const char* string = NULL; // Handle the escape key when the password window is showing
if (message->FindString("bytes", &string) == B_OK const char* string = NULL;
&& string[0] == B_ESCAPE) { if (message->FindString("bytes", &string) == B_OK
be_app->PostMessage(kMsgResumeSaver); && string[0] == B_ESCAPE) {
be_app->PostMessage(kMsgResumeSaver);
}
} }
} }