app_server: perform NULL check before use
Fixes #16610. Change-Id: Ic377a2faef7279f607298b3b80bc44bc1c6aae36 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3401 Reviewed-by: Jérôme Duval <[email protected]> Reviewed-by: Axel Dörfler <[email protected]>
This commit is contained in:
@@ -514,15 +514,15 @@ Desktop::Init()
|
|||||||
fVirtualScreen.SetConfiguration(*this,
|
fVirtualScreen.SetConfiguration(*this,
|
||||||
fWorkspaces[0].CurrentScreenConfiguration());
|
fWorkspaces[0].CurrentScreenConfiguration());
|
||||||
|
|
||||||
float brightness = fWorkspaces[0].StoredScreenConfiguration().Brightness(0);
|
|
||||||
if (brightness > 0)
|
|
||||||
HWInterface()->SetBrightness(brightness);
|
|
||||||
|
|
||||||
if (fVirtualScreen.HWInterface() == NULL) {
|
if (fVirtualScreen.HWInterface() == NULL) {
|
||||||
debug_printf("Could not initialize graphics output. Exiting.\n");
|
debug_printf("Could not initialize graphics output. Exiting.\n");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float brightness = fWorkspaces[0].StoredScreenConfiguration().Brightness(0);
|
||||||
|
if (brightness > 0)
|
||||||
|
HWInterface()->SetBrightness(brightness);
|
||||||
|
|
||||||
fVirtualScreen.HWInterface()->MoveCursorTo(
|
fVirtualScreen.HWInterface()->MoveCursorTo(
|
||||||
fVirtualScreen.Frame().Width() / 2,
|
fVirtualScreen.Frame().Width() / 2,
|
||||||
fVirtualScreen.Frame().Height() / 2);
|
fVirtualScreen.Frame().Height() / 2);
|
||||||
|
|||||||
Reference in New Issue
Block a user