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:
@@ -1469,12 +1469,11 @@ StyledEditWindow::_ReloadDocument(BMessage* message)
|
|||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
const char* name;
|
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;
|
return;
|
||||||
|
|
||||||
fSaveMessage->FindRef("directory", &ref);
|
|
||||||
fSaveMessage->FindString("name", &name);
|
|
||||||
|
|
||||||
BDirectory dir(&ref);
|
BDirectory dir(&ref);
|
||||||
status_t status = dir.InitCheck();
|
status_t status = dir.InitCheck();
|
||||||
BEntry entry;
|
BEntry entry;
|
||||||
|
|||||||
Reference in New Issue
Block a user