From 27820f92647e15149f05a138d6885e93c9c23165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Fri, 12 May 2023 15:55:30 +0200 Subject: [PATCH] Empty entries fix --- nano/node/json_handler.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nano/node/json_handler.cpp b/nano/node/json_handler.cpp index 07629ea1..c67878e2 100644 --- a/nano/node/json_handler.cpp +++ b/nano/node/json_handler.cpp @@ -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);