Skip to content

Commit

Permalink
fix: check collection first in resource remove
Browse files Browse the repository at this point in the history
  • Loading branch information
ilionic committed Jul 8, 2022
1 parent 0221dc8 commit a3abdac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pallets/rmrk-core/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ where
nft_id: NftId,
resource_id: ResourceId,
) -> DispatchResult {
let (root_owner, _) = Pallet::<T>::lookup_root_owner(collection_id, nft_id)?;
let collection = Self::collections(collection_id).ok_or(Error::<T>::CollectionUnknown)?;
let (root_owner, _) = Pallet::<T>::lookup_root_owner(collection_id, nft_id)?;
ensure!(collection.issuer == sender, Error::<T>::NoPermission);
ensure!(
Resources::<T>::contains_key((collection_id, nft_id, resource_id)),
Expand Down

0 comments on commit a3abdac

Please sign in to comment.