Skip to content

Commit

Permalink
Fix send_nft() logic
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolacy committed Sep 29, 2020
1 parent fd322fa commit 8eebcf0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions contracts/cw721-base/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,16 @@ pub fn handle_send_nft<S: Storage, A: Api, Q: Querier>(
token_id: String,
msg: Option<Binary>,
) -> StdResult<HandleResponse> {
_transfer_nft(deps, &env, &contract, &token_id)?;

// Unwrap message
// Unwrap message first
let msgs: Vec<CosmosMsg> = match &msg {
None => vec![],
Some(msg) => from_binary(msg)?,
};

// Transfer token
_transfer_nft(deps, &env, &contract, &token_id)?;

// Send message
Ok(HandleResponse {
messages: msgs,
log: vec![
Expand Down

0 comments on commit 8eebcf0

Please sign in to comment.