From 673481f371ba7a67d52b68e8cf421a112ec5111d Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Tue, 28 Dec 2010 12:55:19 +0000 Subject: [PATCH] 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 --- src/servers/app/Desktop.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/servers/app/Desktop.cpp b/src/servers/app/Desktop.cpp index 63bc85f26e..3cb20e6700 100644 --- a/src/servers/app/Desktop.cpp +++ b/src/servers/app/Desktop.cpp @@ -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; }