diff --git a/smart_contracts/contract/src/contract_api/runtime.rs b/smart_contracts/contract/src/contract_api/runtime.rs index 981e1492ee..ad56d7b14a 100644 --- a/smart_contracts/contract/src/contract_api/runtime.rs +++ b/smart_contracts/contract/src/contract_api/runtime.rs @@ -222,7 +222,7 @@ pub fn try_get_named_arg(name: &str) -> Option { // Avoids allocation with 0 bytes and a call to get_named_arg Vec::new() }; - bytesrepr::deserialize(arg_bytes).unwrap_or_revert_with(ApiError::InvalidArgument) + bytesrepr::deserialize(arg_bytes).ok() } /// Returns the caller of the current context, i.e. the [`AccountHash`] of the account which made