From f3eabae06176ffce5b2b33fa464a9805e0c24cfd Mon Sep 17 00:00:00 2001 From: Juan Potato Date: Mon, 20 Jul 2015 10:31:19 -0400 Subject: [PATCH] Update json-tg.c --- json-tg.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/json-tg.c b/json-tg.c index 5dcf3ea..fece57f 100644 --- a/json-tg.c +++ b/json-tg.c @@ -107,12 +107,15 @@ json_t *json_pack_peer (tgl_peer_id_t id) { default: assert (0); } - + assert (json_object_set (res, "print_name", json_string (s)) >= 0); return res; } - - assert (json_object_set (res, "print_name", json_string (P->print_name)) >= 0); + if(P->print_name != NULL){ + assert (json_object_set (res, "print_name", json_string (P->print_name)) >= 0); + } else { + assert (json_object_set (res, "print_name", json_string ("")) >= 0); + } assert (json_object_set (res, "flags", json_integer (P->flags)) >= 0); switch (tgl_get_peer_type (id)) {