Skip to content

Commit

Permalink
Make FunctionMatch record resilient against missing neighbour_debug f…
Browse files Browse the repository at this point in the history
…ield
  • Loading branch information
fmagin committed Jul 29, 2024
1 parent dbde9ea commit 57b04ad
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public record FunctionMatch(
String nearest_neighbor_binary_name,
BinaryHash nearest_neighbor_sha_256_hash,
BinaryID nearest_neighbor_binary_id,
boolean nearest_neighbor_debug,
Boolean nearest_neighbor_debug,
double confidence
) {
public static FunctionMatch fromJSONObject(JSONObject json) {
Expand All @@ -33,7 +33,7 @@ public static FunctionMatch fromJSONObject(JSONObject json) {
json.getString("nearest_neighbor_binary_name"),
new BinaryHash(json.getString("nearest_neighbor_sha_256_hash")),
new BinaryID(json.getInt("nearest_neighbor_binary_id")),
json.getBoolean("nearest_neighbor_debug"),
json.has("nearest_neighbor_debug") ? json.getBoolean("nearest_neighbor_debug") : null,
json.getDouble("confidence")
);
}
Expand Down

0 comments on commit 57b04ad

Please sign in to comment.