Skip to content

Commit

Permalink
Fix item response position fields parsing (#1044)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvasilak authored Dec 12, 2024
1 parent 583a83c commit 6d803cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Zotero/Models/API/ItemResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ struct ItemResponse {
value = "\(_value.rounded(to: 3))"
} else if let _value = object.value as? Bool {
value = "\(_value)"
} else if let data = try? JSONSerialization.dataWithRoundedDecimals(withJSONObject: object.value), let _value = String(data: data, encoding: .utf8) {
} else if let data = try? JSONSerialization.dataWithRoundedDecimals(withJSONObject: object.value, options: .fragmentsAllowed), let _value = String(data: data, encoding: .utf8) {
// If `object.value` is not a basic type (string or number) convert it to JSON and store JSON string
value = _value
} else {
Expand Down

0 comments on commit 6d803cd

Please sign in to comment.