From 91ef36fa4cca7aee2141a305aa60705e0c3b3c3b Mon Sep 17 00:00:00 2001 From: Nanolucas Date: Fri, 26 Mar 2021 23:48:51 +0100 Subject: [PATCH] add key check to prevent PHP notice --- src/Contract.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Contract.php b/src/Contract.php index dd682c8..7f585c4 100644 --- a/src/Contract.php +++ b/src/Contract.php @@ -893,6 +893,11 @@ class Contract $eventLogData = []; + //if there's no data for this event, no need to proceed further + if (!array_key_exists($eventName, $this->events)) { + return $eventLogData; + } + //indexed and non-indexed event parameters must be treated separately //indexed parameters are stored in the 'topics' array //non-indexed parameters are stored in the 'data' value