File tree 1 file changed +13
-1
lines changed
Thirdweb/Thirdweb.Extensions 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -651,7 +651,19 @@ public static async Task<List<BigInteger>> ERC721A_TokensOfOwnerIn(this Thirdweb
651
651
/// <exception cref="ArgumentNullException">Thrown when the contract is null.</exception>
652
652
public static async Task < BigInteger > ERC721_TotalSupply ( this ThirdwebContract contract )
653
653
{
654
- return contract == null ? throw new ArgumentNullException ( nameof ( contract ) ) : await ThirdwebContract . Read < BigInteger > ( contract , "totalSupply" ) ;
654
+ if ( contract == null )
655
+ {
656
+ throw new ArgumentNullException ( nameof ( contract ) ) ;
657
+ }
658
+
659
+ try
660
+ {
661
+ return await ThirdwebContract . Read < BigInteger > ( contract , "nextTokenIdToMint" ) ;
662
+ }
663
+ catch
664
+ {
665
+ return await ThirdwebContract . Read < BigInteger > ( contract , "totalSupply" ) ;
666
+ }
655
667
}
656
668
657
669
/// <summary>
You can’t perform that action at this time.
0 commit comments