Empty entries fix

This commit is contained in:
Piotr Wójcik 2023-05-12 15:55:30 +02:00
commit 27820f9264

View file

@ -942,7 +942,10 @@ void nano::json_handler::accounts_representatives ()
errors.put (account_from_request.second.data (), ec.message ());
ec = {};
}
response_l.add_child ("representatives", representatives);
if (!representatives.empty ())
{
response_l.add_child ("representatives", representatives);
}
if (!errors.empty ())
{
response_l.add_child ("errors", errors);
@ -1000,7 +1003,10 @@ void nano::json_handler::accounts_frontiers ()
errors.put (account_from_request.second.data (), ec.message ());
ec = {};
}
response_l.add_child ("frontiers", frontiers);
if (!frontiers.empty())
{
response_l.add_child ("frontiers", frontiers);
}
if (!errors.empty ())
{
response_l.add_child ("errors", errors);