diff --git a/programs/thread/src/instructions/thread_kickoff.rs b/programs/thread/src/instructions/thread_kickoff.rs index b7b1b72b..2b4e5566 100644 --- a/programs/thread/src/instructions/thread_kickoff.rs +++ b/programs/thread/src/instructions/thread_kickoff.rs @@ -216,8 +216,14 @@ pub fn handler(ctx: Context) -> Result<()> { // PriceUpdateV2::try_deserialize(&mut account_info.data.borrow().as_ref())?; let data: &[u8] = &account_info.data.borrow()[8..]; - let price_update: PriceUpdateV2 = AnchorDeserialize::try_from_slice(data) - .map_err(|_| SablierError::InvalidOracleAccount)?; + let price_update_maybe: std::result::Result = + AnchorDeserialize::try_from_slice(data); + + if price_update_maybe.is_err() { + return Err(SablierError::InvalidOracleAccount.into()); + } + + let price_update = price_update_maybe.unwrap(); let current_price = price_update.get_price_no_older_than( &Clock::get()?,