From 4e113bbf1b61acd480c858087fdfeb6f7be2143c Mon Sep 17 00:00:00 2001 From: Tamo Date: Fri, 22 Oct 2021 17:49:08 +0200 Subject: [PATCH] handle the case of empty input --- filter_parser/src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/filter_parser/src/lib.rs b/filter_parser/src/lib.rs index 7153c5361..4623f9387 100644 --- a/filter_parser/src/lib.rs +++ b/filter_parser/src/lib.rs @@ -91,6 +91,9 @@ impl<'a> FilterCondition<'a> { } pub fn parse>(input: &'a str) -> Result { + if input.trim().is_empty() { + return Ok(Self::Empty); + } let span = Span::new(input); parse_expression::<'a, E>(span).finish().map(|(_rem, output)| output) }