Skip to content

Commit

Permalink
fix: error in value per 100g parsing
Browse files Browse the repository at this point in the history
fixes OPENFOODFACTS-ANDROID-4JZ
  • Loading branch information
VaiTon committed Oct 1, 2021
1 parent b86bc11 commit f0e4a28
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -69,7 +69,7 @@ class ProductNutriments : Serializable {
*/
private fun getValuePer100g(nutriment: Nutriment) =
getAdditionalProperty(nutriment, Suffix.VALUE_100G)
?.toFloat()
?.toFloatOrNull()
?.let { measure(it, UNIT_GRAM) }

private fun getUnit(nutriment: Nutriment) = getAdditionalProperty(nutriment, Suffix.UNIT)
Expand Down

0 comments on commit f0e4a28

Please sign in to comment.