Skip to content

Commit d37aa48

Browse files
committed
fix: throw error if the param being passed to ctx.contract.create function is not detected to be a contract
1 parent 84fee20 commit d37aa48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/subcontexts/contract-context.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ export class ContractContext {
167167
return false
168168
} else if (proto === Contract) {
169169
return true
170-
} else if (proto === null) {
171-
return false
170+
} else if (proto === Object || proto === null) {
171+
throw new Error('Cannot create a contract for class as it does not extend Contract or BaseContract')
172172
}
173173
return this.isArc4(proto)
174174
}

0 commit comments

Comments
 (0)