Skip to content

Commit

Permalink
Remove unecessary duplicate logic
Browse files Browse the repository at this point in the history
  • Loading branch information
lazarkov committed Aug 8, 2024
1 parent a608b59 commit e0a0349
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions examples/tv-app/android/java/ContentAppCommandDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,25 +222,6 @@ void ContentAppCommandDelegate::FormatResponseData(CommandHandlerInterface::Hand
{
handlerContext.SetCommandHandled();
Json::Value value;
std::unique_ptr<Json::CharReader> testReader(readerBuilder.newCharReader());

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

// Validate and access JSON data safely
if (!value.isObject())
{
ChipLogError(Zcl, "Invalid JSON structure: not an object");
return;
}

if (!reader.parse(response, value))
{
return;
}

// handle errors from platform-app
if (!value[FAILURE_KEY].empty())
Expand Down

0 comments on commit e0a0349

Please sign in to comment.