From 5292c646d96eb8117d6efbafaa6c7c24880e2c95 Mon Sep 17 00:00:00 2001 From: drgorillamd Date: Fri, 27 Oct 2023 16:24:20 +0200 Subject: [PATCH] fix: empty tiers array should be length 0 --- contracts/JBTiered721DelegateStore.sol | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contracts/JBTiered721DelegateStore.sol b/contracts/JBTiered721DelegateStore.sol index 6fe5e184..20bc409c 100644 --- a/contracts/JBTiered721DelegateStore.sol +++ b/contracts/JBTiered721DelegateStore.sol @@ -147,6 +147,9 @@ contract JBTiered721DelegateStore is IJBTiered721DelegateStore { // Keep a reference to the last tier ID. uint256 _lastTierId = _lastSortedTierIdOf(_nft); + // Retuen an empty array if there are no tiers. + if (_lastTierId == 0) return _tiers; + // Initialize an array with the appropriate length. _tiers = new JB721Tier[](_size);