From d4e9e4a5335cf02447ffc64aec87af3e77d02f13 Mon Sep 17 00:00:00 2001 From: Nanolucas Date: Sat, 27 Mar 2021 00:01:37 +0100 Subject: [PATCH] throw an exception if event name isn't found --- src/Contract.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Contract.php b/src/Contract.php index 7f585c4..aa38f34 100644 --- a/src/Contract.php +++ b/src/Contract.php @@ -893,9 +893,9 @@ class Contract $eventLogData = []; - //if there's no data for this event, no need to proceed further + //ensure the event actually exists before trying to filter for it if (!array_key_exists($eventName, $this->events)) { - return $eventLogData; + throw new InvalidArgumentException("'{$eventName}' does not exist in the ABI for this contract"); } //indexed and non-indexed event parameters must be treated separately