Skip to content

Commit 8d05623

Browse files
authored
Merge pull request #6 from yakubido/master
fix empty topics
2 parents 22a1762 + cd2d412 commit 8d05623

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Coder.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ public function decodeLogs(array $logs): array
4646
$topics = array_slice(array_get($logs, '0.topics', []), 1);
4747
$topicId = substr(array_first(array_get($logs, '0.topics', [])), 2);
4848

49+
if (empty($topics) || is_null($data))
50+
{
51+
return [];
52+
}
53+
4954
foreach ($this->contract->getEvents() as $event)
5055
{
5156
$id = $this->encodeEventSignature($event);

0 commit comments

Comments
 (0)