jhsenjaliya commented on a change in pull request #1001: [EAGLE-1096] getJSONArray may cause exception, optJSONArray can be used URL: https://github.com/apache/eagle/pull/1001#discussion_r275139161
########## File path: eagle-topology-check/eagle-topology-app/src/main/java/org/apache/eagle/topology/utils/JMXQueryHelper.java ########## @@ -56,7 +56,7 @@ final Map<String, JMXBean> resultMap = new HashMap<String, JMXBean>(); final JSONTokener tokener = new JSONTokener(is); final JSONObject jsonBeansObject = new JSONObject(tokener); - final JSONArray jsonArray = jsonBeansObject.getJSONArray("beans"); + final JSONArray jsonArray = jsonBeansObject.optJSONArray("beans"); int size = jsonArray.length(); Review comment: if jsonArray is going to be null, can u add that handling as well ? Thanks ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services