Skip to content

Commit

Permalink
fix: fixed serialization of strings twice
Browse files Browse the repository at this point in the history
  • Loading branch information
desusai7 committed Feb 6, 2024
1 parent 55521b6 commit 833c40f
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ public static String getDeviceId(Application application) {
}

public static Map<String, Object> convertToMap(Object obj) {
String json = RudderGson.serialize(obj);
String json;
if (obj instanceof String) {
json = (String) obj;
} else {
json = RudderGson.serialize(obj);
}
if (json == null) {
return new HashMap<>();
}
Expand All @@ -108,7 +113,13 @@ public static Map<String, Object> convertToMap(Object obj) {


public static List<Map<String, Object>> convertToList(Object obj) {
String json = RudderGson.serialize(obj);
String json;
if (obj instanceof String) {
json = (String) obj;
} else {
json = RudderGson.serialize(obj);
}

if (json == null) {
return new ArrayList<>();
}
Expand Down

0 comments on commit 833c40f

Please sign in to comment.