Fix BHandler::GetSupportedSuites()

The logic was reversed accidentally in hrev47355

Rewrite the method to make more sense. If data is NULL return
B_BAD_VALUE right away. Otherwise set the status based on the first
operation, if that succeeds perform a second one, and return the
result.

Fixes CID 1222666
This commit is contained in:
John Scipione 2014-06-12 13:54:23 -04:00
parent edc845a323
commit 2776568d27

View File

@ -510,19 +510,16 @@ BMessage: what = (0x0, or 0)
property_info array is declared in the globals section. property_info array is declared in the globals section.
*/ */
status_t err = B_OK;
if (data == NULL) if (data == NULL)
err = B_BAD_VALUE; return B_BAD_VALUE;
if (err != B_OK) { status_t result = data->AddString("suites", "suite/vnd.Be-handler");
err = data->AddString("suites", "suite/vnd.Be-handler"); if (result == B_OK) {
if (err != B_OK) { BPropertyInfo propertyInfo(sHandlerPropInfo);
BPropertyInfo propertyInfo(sHandlerPropInfo); result = data->AddFlat("messages", &propertyInfo);
err = data->AddFlat("messages", &propertyInfo);
}
} }
return err; return result;
} }