From bad2cb03f82006fddc8e26fdca07e49613fb3bfc Mon Sep 17 00:00:00 2001 From: Jennifer Richards Date: Thu, 26 Apr 2018 16:51:33 -0400 Subject: [PATCH] Correctly display RP realms in the 'show communities' response --- common/tr_comm_encoders.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/common/tr_comm_encoders.c b/common/tr_comm_encoders.c index 2655fe5..c33c604 100644 --- a/common/tr_comm_encoders.c +++ b/common/tr_comm_encoders.c @@ -179,9 +179,14 @@ static json_t *tr_comm_realms_to_json(TR_COMM_TABLE *ctable, TR_NAME *comm_name, realm_json = json_object(); OBJECT_SET_OR_FAIL(realm_json, "realm", tr_name_to_json_string(tr_realm_get_id(realm))); - memb = tr_comm_table_find_idp_memb(ctable, - tr_realm_get_id(realm), - comm_name); + memb = tr_comm_table_find_memb(ctable, + tr_realm_get_id(realm), + comm_name); + if (memb == NULL) { + /* This should not happen - there must be a matching membership if we + * believed the realm was in the community in the first place! */ + goto cleanup; + } OBJECT_SET_OR_FAIL(realm_json, "sources", tr_comm_memb_sources_to_json(memb)); json_array_append_new(jarray, realm_json); -- 2.1.4