From: Matt Corallo Date: Fri, 28 Oct 2022 05:53:01 +0000 (+0000) Subject: [Java] Handle nullable arrays X-Git-Tag: v0.0.112.0^2~9 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=890e35a4387758c0447aab34166caa579bbf3a08;p=ldk-java [Java] Handle nullable arrays --- diff --git a/src/main/java/org/ldk/util/InternalUtils.java b/src/main/java/org/ldk/util/InternalUtils.java index f26c2ae0..d9c3f6ef 100644 --- a/src/main/java/org/ldk/util/InternalUtils.java +++ b/src/main/java/org/ldk/util/InternalUtils.java @@ -2,7 +2,7 @@ package org.ldk.util; public class InternalUtils { public static byte[] check_arr_len(byte[] arr, int length) throws IllegalArgumentException { - if (arr.length != length) { + if (arr != null && arr.length != length) { throw new IllegalArgumentException("Array must be of fixed size " + length + " but was of length " + arr.length); } return arr;