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>```:
28
28
<dependency>
29
29
<groupId>com.github.leonardofel</groupId>
30
30
<artifactId>json-java-put-null-fix</artifactId>
31
- <version>3.0.33 </version>
31
+ <version>3.0.34 </version>
32
32
</dependency>
33
33
</dependencies>
34
34
```
Original file line number Diff line number Diff line change 3
3
4
4
<groupId >com.github.leonardofel</groupId >
5
5
<artifactId >json-java-put-null-fix</artifactId >
6
- <version >3.0.33 </version >
6
+ <version >3.0.34 </version >
7
7
<packaging >jar</packaging >
8
8
9
9
<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() {
256
256
* If there is no value for the index.
257
257
*/
258
258
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 ());
262
263
}
263
- return object ;
264
264
}
265
265
266
266
/**
Original file line number Diff line number Diff line change @@ -568,14 +568,11 @@ public static String doubleToString(double d) {
568
568
* if the key is not found.
569
569
*/
570
570
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 ());
577
575
}
578
- return object ;
579
576
}
580
577
581
578
/**
You can’t perform that action at this time.
0 commit comments