From 43de35ee65f5097abafb898210e7921a4a7d7665 Mon Sep 17 00:00:00 2001 From: Matthew Harmsen Date: Thu, 13 Nov 2014 14:14:56 -0700 Subject: [PATCH] Check for null values in GetConfigEntries * Bugzilla Bug #1155654 - Replica install fails when using --setup-ca option (AKA - PKI TRAC Ticket #1142 - NPE in getconfigEntries when internaldb password is removed from master) --- .../com/netscape/cms/servlet/csadmin/GetConfigEntries.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/base/server/cms/src/com/netscape/cms/servlet/csadmin/GetConfigEntries.java b/base/server/cms/src/com/netscape/cms/servlet/csadmin/GetConfigEntries.java index ee013ef..dcb8bdf 100644 --- a/base/server/cms/src/com/netscape/cms/servlet/csadmin/GetConfigEntries.java +++ b/base/server/cms/src/com/netscape/cms/servlet/csadmin/GetConfigEntries.java @@ -180,9 +180,11 @@ public class GetConfigEntries extends CMSServlet { continue; } - Node container = xmlObj.createContainer(root, "Config"); - xmlObj.addItemToContainer(container, "name", name); - xmlObj.addItemToContainer(container, "value", value); + if (value != null) { + Node container = xmlObj.createContainer(root, "Config"); + xmlObj.addItemToContainer(container, "name", name); + xmlObj.addItemToContainer(container, "value", value); + } } } @@ -192,7 +194,8 @@ public class GetConfigEntries extends CMSServlet { outputResult(httpResp, "application/xml", cb); } catch (Exception e) { - CMS.debug("Failed to send the XML output"); + CMS.debug("Failed to send the XML output: " + e); + e.printStackTrace(); } } -- 1.8.3.1