File tree Expand file tree Collapse file tree 4 files changed +10
-13
lines changed Expand file tree Collapse file tree 4 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ In project's pom.xml add in ```<dependencies>```:
2828 <dependency>
2929 <groupId>com.github.leonardofel</groupId>
3030 <artifactId>json-java-put-null-fix</artifactId>
31- <version>3.0.33 </version>
31+ <version>3.0.34 </version>
3232 </dependency>
3333</dependencies>
3434```
Original file line number Diff line number Diff line change 33
44 <groupId >com.github.leonardofel</groupId >
55 <artifactId >json-java-put-null-fix</artifactId >
6- <version >3.0.33 </version >
6+ <version >3.0.34 </version >
77 <packaging >jar</packaging >
88
99 <name >JSON in Java WITH WORKING .put(null)</name >
Original file line number Diff line number Diff line change @@ -256,11 +256,11 @@ public Iterator<Object> iterator() {
256256 * If there is no value for the index.
257257 */
258258 public Object get (int index ) throws JSONException {
259- Object object = this .opt (index );
260- if (object == null ) {
261- throw new JSONException ("JSONArray[" + index + "] not found." );
259+ try {
260+ return this .opt (index );
261+ } catch (Exception e ) {
262+ throw new JSONException (e .getMessage ());
262263 }
263- return object ;
264264 }
265265
266266 /**
Original file line number Diff line number Diff line change @@ -568,14 +568,11 @@ public static String doubleToString(double d) {
568568 * if the key is not found.
569569 */
570570 public Object get (String key ) throws JSONException {
571- if (key == null ) {
572- throw new JSONException ("Null key." );
573- }
574- Object object = this .opt (key );
575- if (object == null ) {
576- throw new JSONException ("JSONObject[" + quote (key ) + "] not found." );
571+ try {
572+ return this .map .get (key );
573+ } catch (Exception e ) {
574+ throw new JSONException (e .getMessage ());
577575 }
578- return object ;
579576 }
580577
581578 /**
You can’t perform that action at this time.
0 commit comments