Fix undefined is not an object exception (#535)

This commit is contained in:
Kirill Fedoseev 2021-03-26 21:16:23 +03:00 committed by GitHub
parent b6ba0744b9
commit dc3026e584
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -173,7 +173,7 @@ export const getLogs = async (
url.searchParams.append('action', 'getLogs') url.searchParams.append('action', 'getLogs')
url.searchParams.append('address', contract.options.address) url.searchParams.append('address', contract.options.address)
url.searchParams.append('fromBlock', options.fromBlock.toString()) url.searchParams.append('fromBlock', options.fromBlock.toString())
url.searchParams.append('toBlock', options.toBlock.toString() || 'latest') url.searchParams.append('toBlock', (options.toBlock || 'latest').toString())
const topics = [web3.eth.abi.encodeEventSignature(abi), ...(options.topics || [])] const topics = [web3.eth.abi.encodeEventSignature(abi), ...(options.topics || [])]
for (let i = 0; i < topics.length; i++) { for (let i = 0; i < topics.length; i++) {