From 2776568d27f68e05867561652f489a68124f9d8f Mon Sep 17 00:00:00 2001 From: John Scipione Date: Thu, 12 Jun 2014 13:54:23 -0400 Subject: [PATCH] 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 --- src/kits/app/Handler.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/kits/app/Handler.cpp b/src/kits/app/Handler.cpp index f4443ca757..b158f0ee8a 100644 --- a/src/kits/app/Handler.cpp +++ b/src/kits/app/Handler.cpp @@ -510,19 +510,16 @@ BMessage: what = (0x0, or 0) property_info array is declared in the globals section. */ - status_t err = B_OK; if (data == NULL) - err = B_BAD_VALUE; + return B_BAD_VALUE; - if (err != B_OK) { - err = data->AddString("suites", "suite/vnd.Be-handler"); - if (err != B_OK) { - BPropertyInfo propertyInfo(sHandlerPropInfo); - err = data->AddFlat("messages", &propertyInfo); - } + status_t result = data->AddString("suites", "suite/vnd.Be-handler"); + if (result == B_OK) { + BPropertyInfo propertyInfo(sHandlerPropInfo); + result = data->AddFlat("messages", &propertyInfo); } - return err; + return result; }