screen_blanker: Check if be_app is NULL
... before using it after dynamic_cast. Fixes CID 1130496
This commit is contained in:
@@ -57,8 +57,9 @@ 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);
|
||||||
|
if (app != NULL && app->IsPasswordWindowShown()) {
|
||||||
// Handle the escape key when the password window is showing
|
// Handle the escape key when the password window is showing
|
||||||
const char* string = NULL;
|
const char* string = NULL;
|
||||||
if (message->FindString("bytes", &string) == B_OK
|
if (message->FindString("bytes", &string) == B_OK
|
||||||
@@ -66,6 +67,7 @@ ScreenSaverFilter::Filter(BMessage* message, BHandler** target)
|
|||||||
be_app->PostMessage(kMsgResumeSaver);
|
be_app->PostMessage(kMsgResumeSaver);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return B_DISPATCH_MESSAGE;
|
return B_DISPATCH_MESSAGE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user