Skip to content

Commit e44df2f

Browse files
committed
add: check for burn_nft
1 parent 7512eb7 commit e44df2f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

frame/nft/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ pub mod pallet {
266266
}
267267

268268
pub fn burn_nft(token_id: TokenId, owner: &T::AccountId) -> dispatch::DispatchResult {
269+
ensure!(
270+
AccountForToken::<T>::contains_key(token_id),
271+
Error::<T>::NonExistentToken
272+
);
269273
Self::dec_total_for_account(owner)?;
270274

271275
TokensList::<T>::mutate(&owner, |tuple_tokens| {

0 commit comments

Comments
 (0)