Skip to content

Commit 530b6a0

Browse files
authored
Merge pull request #17 from niftykit-inc/address-error
Adds smart contract error message
2 parents 2273397 + 14d3625 commit 530b6a0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/DropKit.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default class DropKit {
7171
): Promise<DropApiResponse> {
7272
const data = await DropKit.getCollectionData(this.apiKey, this.dev)
7373

74-
if (!data || !data.address || !data.collectionId) {
74+
if (!data || !data.collectionId) {
7575
throw new Error('Collection is not ready yet.')
7676
}
7777

@@ -112,6 +112,9 @@ export default class DropKit {
112112
this.walletAddress = await this.signer.getAddress()
113113
signerOrProvider = this.signer
114114
}
115+
if (!this.address) {
116+
throw new Error('Smart contract is not deployed yet.')
117+
}
115118
this.contract = new ethers.Contract(data.address, abi, signerOrProvider)
116119
if (!this.contract) {
117120
throw new Error('Initialization failed.')

0 commit comments

Comments
 (0)