[
https://issues.apache.org/jira/browse/UNOMI-224?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Serge Huber resolved UNOMI-224.
-------------------------------
Resolution: Fixed
Fix Version/s: 1.4.0
Thanks for the correction, it has been merged into master.
> 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
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.4.0
>
> Attachments: 1.patch
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> 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)