Skip to content

Commit

Permalink
Implement error for jetro error type
Browse files Browse the repository at this point in the history
Fix issue with filter on non objects
  • Loading branch information
mitghi committed Mar 11, 2023
1 parent 386f60d commit a5b8e8b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ impl fmt::Display for Error {
}
}

impl std::error::Error for Error {}

macro_rules! push_to_stack_or_produce {
($results:expr, $stack:expr, $tail:expr, $value:expr) => {
let tlen = $tail.len();
Expand Down Expand Up @@ -362,7 +364,11 @@ macro_rules! do_comparision {

impl FilterInner {
fn eval(&self, entry: &Value) -> bool {
let obj = entry.as_object().unwrap();
let obj = if let Some(output) = entry.as_object() {
output
} else {
return false;
};
match self {
FilterInner::Cond {
ref left,
Expand Down

0 comments on commit a5b8e8b

Please sign in to comment.