Skip to content

Commit

Permalink
Mailbox: Zero address handling for custom_hook alongside Option::None
Browse files Browse the repository at this point in the history
  • Loading branch information
EgeCaner committed Feb 14, 2025
1 parent 29fd5f1 commit 83a814a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cairo/crates/contracts/src/mailbox.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,13 @@ pub mod mailbox {
_custom_hook: Option<ContractAddress>
) -> u256 {
let hook = match _custom_hook {
Option::Some(hook) => hook,
Option::Some(hook) => {
if hook != contract_address_const::<0>() {
hook
} else {
self.default_hook.read()
}
},
Option::None(()) => self.default_hook.read(),
};
let hook_metadata = match _custom_hook_metadata {
Expand Down

0 comments on commit 83a814a

Please sign in to comment.