Compare commits

...

1 Commits

Author SHA1 Message Date
Moody Salem
3d95b1a33b fix access of undefined property 2021-05-13 09:37:04 -05:00

View File

@@ -142,7 +142,7 @@ export function swapErrorToUserReadableMessage(error: any): string {
let reason: string | undefined
while (Boolean(error)) {
reason = error.reason ?? error.message ?? reason
error = error.error ?? error.data.originalError
error = error.error ?? error.data?.originalError
}
if (reason?.indexOf('execution reverted: ') === 0) reason = reason.substr('execution reverted: '.length)