You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2019/07/22 12:59:46 UTC

[wicket] branch wicket-7.x updated: WICKET-6690 NullPointerException in KeyInSessionSunJceCryptFactory.

This is an automated email from the ASF dual-hosted git repository.

mgrigorov pushed a commit to branch wicket-7.x
in repository https://gitbox.apache.org/repos/asf/wicket.git


The following commit(s) were added to refs/heads/wicket-7.x by this push:
     new 206efd3  WICKET-6690 NullPointerException in KeyInSessionSunJceCryptFactory.<init>
206efd3 is described below

commit 206efd3e24f051fae7a26fd5290ea82ee83eabc8
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
AuthorDate: Mon Jul 22 15:58:25 2019 +0300

    WICKET-6690 NullPointerException in KeyInSessionSunJceCryptFactory.<init>
    
    Add a null check for Security.getProviders(String)
    
    (cherry picked from commit 1c39dd7aefdafc0c4bafcc9e1107665f25b9dd99)
---
 .../apache/wicket/core/util/crypt/KeyInSessionSunJceCryptFactory.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/KeyInSessionSunJceCryptFactory.java b/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/KeyInSessionSunJceCryptFactory.java
index ce3037e..ae4b8a2 100644
--- a/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/KeyInSessionSunJceCryptFactory.java
+++ b/wicket-core/src/main/java/org/apache/wicket/core/util/crypt/KeyInSessionSunJceCryptFactory.java
@@ -64,7 +64,8 @@ public class KeyInSessionSunJceCryptFactory implements ICryptFactory
 	{
 		this.cryptMethod = Args.notNull(cryptMethod, "Crypt method");
 
-		if (Security.getProviders("Cipher." + cryptMethod).length == 0)
+		final Provider[] providers = Security.getProviders("Cipher." + cryptMethod);
+		if (providers == null || providers.length == 0)
 		{
 			try
 			{