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 ()); errors.put (account_from_request.second.data (), ec.message ());
ec = {}; ec = {};
} }
if (!representatives.empty ())
{
response_l.add_child ("representatives", representatives); response_l.add_child ("representatives", representatives);
}
if (!errors.empty ()) if (!errors.empty ())
{ {
response_l.add_child ("errors", errors); 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 ()); errors.put (account_from_request.second.data (), ec.message ());
ec = {}; ec = {};
} }
if (!frontiers.empty())
{
response_l.add_child ("frontiers", frontiers); response_l.add_child ("frontiers", frontiers);
}
if (!errors.empty ()) if (!errors.empty ())
{ {
response_l.add_child ("errors", errors); response_l.add_child ("errors", errors);