bd2019us created UNOMI-224:
------------------------------

             Summary: JSONObject.getString() may cause exception, optString() 
should be used.
                 Key: UNOMI-224
                 URL: https://issues.apache.org/jira/browse/UNOMI-224
             Project: Apache Unomi
          Issue Type: Bug
            Reporter: bd2019us


Location : 
tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/impl/MigrationTo121.java:104,106,116

The method JSONObject.getString(key) may throw JSONException when the key does 
not exist, which will crash the program. To ensure safety, the 
JSONObject.optString(key) should be used, which will return a default value 
("") when the key does not exist and avoid program to crash.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to