Commit 3d95b1a3 authored by Moody Salem's avatar Moody Salem

fix access of undefined property

parent 5c969429
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment