From c6751684c101cf55614ff272e3611c1a53a6825f Mon Sep 17 00:00:00 2001 From: Chaiyong Ragkhitwetsagul Date: Tue, 4 Mar 2025 11:38:50 +0700 Subject: [PATCH] Update PKCS12Test.java Add direct object comparison and a null check to avoid NullPointerException in the `isEqual()` method. --- .../test/java/org/bouncycastle/crypto/test/PKCS12Test.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/src/test/java/org/bouncycastle/crypto/test/PKCS12Test.java b/core/src/test/java/org/bouncycastle/crypto/test/PKCS12Test.java index a5402aeae0..04c3157eed 100644 --- a/core/src/test/java/org/bouncycastle/crypto/test/PKCS12Test.java +++ b/core/src/test/java/org/bouncycastle/crypto/test/PKCS12Test.java @@ -26,6 +26,13 @@ private boolean isEqual( byte[] a, byte[] b) { + if(a == b){ + return true; + } + if(null == a || null == b){ + return false; + } + if (a.length != b.length) { return false;