CID 2502: Check the FindMessage return which also safes a needless FindRect call
in the error case. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39978 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -952,10 +952,13 @@ Desktop::WorkspaceFrame(int32 index) const
|
|||||||
frame = fVirtualScreen.Frame();
|
frame = fVirtualScreen.Frame();
|
||||||
else if (index >= 0 && index < fSettings->WorkspacesCount()) {
|
else if (index >= 0 && index < fSettings->WorkspacesCount()) {
|
||||||
BMessage screenData;
|
BMessage screenData;
|
||||||
fSettings->WorkspacesMessage(index)->FindMessage("screen", &screenData);
|
if (fSettings->WorkspacesMessage(index)->FindMessage("screen",
|
||||||
if (screenData.FindRect("frame", &frame) != B_OK)
|
&screenData) != B_OK
|
||||||
|
|| screenData.FindRect("frame", &frame) != B_OK) {
|
||||||
frame = fVirtualScreen.Frame();
|
frame = fVirtualScreen.Frame();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return frame;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user