Make sure to throw an exception if the AlgorithmSuite is not recognised

Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e8cfc24e
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e8cfc24e
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e8cfc24e

Branch: refs/heads/master
Commit: e8cfc24ea0ffbadffae39926f03e74cee6f98254
Parents: 829fead
Author: Colm O hEigeartaigh <[email protected]>
Authored: Wed Aug 5 12:14:52 2015 +0100
Committer: Colm O hEigeartaigh <[email protected]>
Committed: Wed Aug 5 12:21:44 2015 +0100

----------------------------------------------------------------------
 .../cxf/ws/security/policy/custom/AlgorithmSuiteBuilder.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e8cfc24e/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/custom/AlgorithmSuiteBuilder.java
----------------------------------------------------------------------
diff --git 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/custom/AlgorithmSuiteBuilder.java
 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/custom/AlgorithmSuiteBuilder.java
index 56b650d..d5ce360 100644
--- 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/custom/AlgorithmSuiteBuilder.java
+++ 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/custom/AlgorithmSuiteBuilder.java
@@ -57,7 +57,7 @@ public class AlgorithmSuiteBuilder implements 
AssertionBuilder<Element> {
             loader = new DefaultAlgorithmSuiteLoader();
         }
         AlgorithmSuite algorithmSuite = loader.getAlgorithmSuite(bus, 
spVersion, nestedPolicy);
-        if (algorithmSuite == null) {
+        if (algorithmSuite == null || algorithmSuite.getAlgorithmSuiteType() 
== null) {
             String algorithmSuiteName = 
DOMUtils.getFirstElement(nestedPolicyElement).getLocalName();
             throw new IllegalArgumentException(
                 "Algorithm suite \"" + algorithmSuiteName + "\" is not 
registered"

Reply via email to