Do not try to parse empty faceted strings

This commit is contained in:
Clément Renault 2020-11-13 18:33:51 +01:00
parent 23f9a22edc
commit f9cc12ae0f
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -586,9 +586,11 @@ fn parse_facet_value(ftype: FacetType, value: &Value) -> anyhow::Result<SmallVec
}, },
}, },
Value::String(string) => { Value::String(string) => {
let string = string.trim();
if string.is_empty() { return Ok(()) }
match ftype { match ftype {
FacetType::String => { FacetType::String => {
let string = SmallString32::from(string.as_str()); let string = SmallString32::from(string);
Ok(output.push(String(string))) Ok(output.push(String(string)))
}, },
FacetType::Float => match string.parse() { FacetType::Float => match string.parse() {