Skip to content

Commit

Permalink
Added expect error message to TimeFeedback where there used to be an …
Browse files Browse the repository at this point in the history
…unwrap (#2777)

* Added expect error message to TimeFeedback where there used to be an unwrap

* Changed error message handling

* fixed cargo clippy

---------

Co-authored-by: Dominik Maier <[email protected]>
  • Loading branch information
AshrafIbrahim03 and domenukk authored Dec 30, 2024
1 parent 8cd069c commit 92db678
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libafl/src/feedbacks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,12 @@ where
observers: &OT,
testcase: &mut Testcase<I>,
) -> Result<(), Error> {
let observer = observers.get(&self.observer_handle).unwrap();
let Some(observer) = observers.get(&self.observer_handle) else {
return Err(Error::illegal_state(
"Observer referenced by TimeFeedback is not found in observers given to the fuzzer",
));
};

*testcase.exec_time_mut() = *observer.last_runtime();
Ok(())
}
Expand Down

0 comments on commit 92db678

Please sign in to comment.