Skip to content

Commit a5ede3f

Browse files
committed
chore
1 parent 9acd01d commit a5ede3f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

core/src/main/java/cn/leancloud/gson/GeneralSimpleObjectAdapter.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,12 @@ public T read(JsonReader jsonReader) throws IOException {
109109
value = jsonReader.nextDouble();
110110
} else if (valueType.equals(Double.class) || valueType.equals(double.class)) {
111111
value = jsonReader.nextDouble();
112+
} else {
113+
jsonReader.skipValue();
114+
}
115+
if (null != value) {
116+
targetField.set(result, value);
112117
}
113-
targetField.set(result, value);
114118
} catch (Exception ex) {
115119
ex.printStackTrace();
116120
}

core/src/main/java/cn/leancloud/gson/JSONObjectAdapter.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import java.io.IOException;
1111

1212
public class JSONObjectAdapter extends TypeAdapter<JSONObject> {
13-
private MapDeserializerDoubleAsIntFix mapDeserializerDoubleAsIntFix = new MapDeserializerDoubleAsIntFix();
1413
public void write(JsonWriter writer, JSONObject object) throws IOException {
1514
if (!(object instanceof GsonObject)) {
1615
writer.nullValue();

0 commit comments

Comments
 (0)