Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashutosh Gupta committed Sep 23, 2022
1 parent f28c025 commit b8d0d52
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,15 @@ static Map<String, Object> toJsonMap(

public static String toJsonString(BlockLocation[] locations)
throws IOException {
final Map<String, Object> m = toJsonMap(locations);
if (locations == null) {
return null;
}
final Map<String, Object> m = new HashMap<>();
Object[] blockLocations = new Object[locations.length];
for(int i=0; i<locations.length; i++) {
blockLocations[i] = toJsonMap(locations[i]);
}
m.put(BlockLocation.class.getSimpleName(), blockLocations);
return toJsonString("BlockLocations", m);
}

Expand Down

0 comments on commit b8d0d52

Please sign in to comment.