screen_blanker: Check if be_app is NULL
... before using it after dynamic_cast. Fixes CID 1130496
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user