Fix CID992335,CID992334: Check FindRef/String returns

Satisfy Coverity by checking return values of FindRef and FindString
calls for fSavedMessage.

Resolves CID992335 and CID992334.
This commit is contained in:
Siarzhuk Zharski 2013-04-05 16:34:47 +02:00
parent 9f2cce2faa
commit 4755a0794e

View File

@ -1469,12 +1469,11 @@ StyledEditWindow::_ReloadDocument(BMessage* message)
entry_ref ref;
const char* name;
if (fSaveMessage == NULL || message == NULL)
if (fSaveMessage == NULL || message == NULL
|| fSaveMessage->FindRef("directory", &ref) != B_OK
|| fSaveMessage->FindString("name", &name) != B_OK)
return;
fSaveMessage->FindRef("directory", &ref);
fSaveMessage->FindString("name", &name);
BDirectory dir(&ref);
status_t status = dir.InitCheck();
BEntry entry;