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:14 UTC

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

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 1c39dd7  WICKET-6690 NullPointerException in KeyInSessionSunJceCryptFactory.<init>
1c39dd7 is described below

commit 1c39dd7aefdafc0c4bafcc9e1107665f25b9dd99
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)
---
 .../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 3afb05f..556c1ff 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
 			{