Skip to content

Commit

Permalink
Merge pull request #1974 from lzgh0102/fix-dynamic-array-decode-null-…
Browse files Browse the repository at this point in the history
…pointer

Fix dynamic array decode null pointer
  • Loading branch information
NickSneo authored Oct 19, 2023
2 parents dba4dfb + f9a3735 commit 919e93e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions abi/src/main/java/org/web3j/abi/TypeDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,9 @@ private static <T extends Type> T decodeDynamicParameterFromStruct(
if (DynamicStruct.class.isAssignableFrom(declaredField)) {
value = decodeDynamicStruct(dynamicElementData, 0, TypeReference.create(declaredField));
} else if (DynamicArray.class.isAssignableFrom(declaredField)) {
if (parameter == null) {
throw new RuntimeException("parameter can not be null, try to use annotation @Parameterized to specify the parameter type");
}
value =
(T)
decodeDynamicArray(
Expand Down

0 comments on commit 919e93e

Please sign in to comment.