From 890e35a4387758c0447aab34166caa579bbf3a08 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 28 Oct 2022 05:53:01 +0000 Subject: [PATCH] [Java] Handle nullable arrays --- src/main/java/org/ldk/util/InternalUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.5