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:
parent
951366c59d
commit
673481f371
@ -952,10 +952,13 @@ Desktop::WorkspaceFrame(int32 index) const
|
||||
frame = fVirtualScreen.Frame();
|
||||
else if (index >= 0 && index < fSettings->WorkspacesCount()) {
|
||||
BMessage screenData;
|
||||
fSettings->WorkspacesMessage(index)->FindMessage("screen", &screenData);
|
||||
if (screenData.FindRect("frame", &frame) != B_OK)
|
||||
if (fSettings->WorkspacesMessage(index)->FindMessage("screen",
|
||||
&screenData) != B_OK
|
||||
|| screenData.FindRect("frame", &frame) != B_OK) {
|
||||
frame = fVirtualScreen.Frame();
|
||||
}
|
||||
}
|
||||
|
||||
return frame;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user