Skip to content

Commit b80a142

Browse files
committed
Catch method parser exceptions
1 parent 6c00bd7 commit b80a142

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ethereumkit/src/main/java/io/horizontalsystems/ethereumkit/contracts/ContractMethodFactories.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ open class ContractMethodFactories {
2525

2626
val methodFactory = methodFactories[methodId.toInt()]
2727

28-
return methodFactory?.createMethod(input.copyOfRange(4, input.size))
28+
return try {
29+
methodFactory?.createMethod(input.copyOfRange(4, input.size))
30+
} catch (e: IndexOutOfBoundsException) {
31+
null
32+
}
2933
}
3034

3135
}

0 commit comments

Comments
 (0)