Skip to content

Commit 360a102

Browse files
restyled-commitslazarkov
authored andcommitted
Restyled by clang-format
1 parent d3d6e73 commit 360a102

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

examples/tv-app/android/java/ContentAppCommandDelegate.cpp

+9-5
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,15 @@ bool isValidJson(const char * response)
5959
Json::Value value;
6060
std::unique_ptr<Json::CharReader> testReader(readerBuilder.newCharReader());
6161

62-
if (!testReader->parse(response, response + std::strlen(response), &value, &errors)) {
62+
if (!testReader->parse(response, response + std::strlen(response), &value, &errors))
63+
{
6364
ChipLogError(Zcl, "Failed to parse JSON: %s\n", errors.c_str());
6465
return false;
6566
}
6667

6768
// Validate and access JSON data safely
68-
if (!value.isObject()) {
69+
if (!value.isObject())
70+
{
6971
ChipLogError(Zcl, "Invalid JSON structure: not an object");
7072
return false;
7173
}
@@ -123,13 +125,15 @@ void ContentAppCommandDelegate::InvokeCommand(CommandHandlerInterface::HandlerCo
123125
{
124126
JniUtfString respStr(env, resp);
125127
ChipLogProgress(Zcl, "ContentAppCommandDelegate::InvokeCommand got response %s", respStr.c_str());
126-
if (isValidJson(respStr.c_str())) {
128+
if (isValidJson(respStr.c_str()))
129+
{
127130
FormatResponseData(handlerContext, respStr.c_str());
128-
} else {
131+
}
132+
else
133+
{
129134
// return dummy value in case JSON is invalid
130135
FormatResponseData(handlerContext, "{\"value\":{}}");
131136
}
132-
133137
}
134138
env->DeleteLocalRef(resp);
135139
}

0 commit comments

Comments
 (0)