Repository navigation
fix(sdk): return undefined from parseFillLogs on empty logs - #272
devtechedge wants to merge 1 commit into
Conversation
Guard against reading logs[0] when the caller passes an empty array so parseFillLogs returns undefined instead of throwing a TypeError. Fixes #268
|
@devtechedge is attempting to deploy a commit to the UMA Team on Vercel. A member of the Team first needs to authorize it. |
|
|
Hi - soft check-in on this one whenever you have a spare moment.
This adds an early The diff stays small in Happy to rebase, rename the guard, or add another case if that helps review - no rush from my side. |
Summary
parseFillLogscurrently buildsblockDatafromlogs[0]before checking whether any fill event is present. When callers pass an emptylogsarray (a valid "no fill found" case), that access throws aTypeErrorinstead of returningundefined.This change adds an early return for
logs.length === 0, matching the existing no-match behavior for non-empty logs that do not contain a fill event.Changes
parseFillLogsso an emptylogsarray returnsundefinedTest plan
vitest run test/unit/actions/parseFillLogs.test.ts(empty array and non-fill logs both returnundefined)undefinedcontinue to work as expectedFixes #268