camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/3] camel git commit: CAMEL-9522: Fixed potential NPE
Date Tue, 19 Jan 2016 18:49:19 GMT
Repository: camel
Updated Branches:
  refs/heads/master c0561ed7c -> a4b611d7c


CAMEL-9522: Fixed potential NPE


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

Branch: refs/heads/master
Commit: 85ad128f237a684b9a183c54ad2d5318a4299e12
Parents: c0561ed
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Jan 19 18:49:04 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Jan 19 18:49:04 2016 +0100

----------------------------------------------------------------------
 .../org/apache/camel/model/language/ExpressionDefinition.java | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/85ad128f/camel-core/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java
b/camel-core/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java
index cf8b1a5..e77f454 100644
--- a/camel-core/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/language/ExpressionDefinition.java
@@ -33,6 +33,7 @@ import org.apache.camel.AfterPropertiesConfigured;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
 import org.apache.camel.Expression;
+import org.apache.camel.NoSuchLanguageException;
 import org.apache.camel.Predicate;
 import org.apache.camel.model.OtherAttributesAware;
 import org.apache.camel.spi.Language;
@@ -156,6 +157,9 @@ public class ExpressionDefinition implements Expression, Predicate, OtherAttribu
             } else if (getExpression() != null) {
                 ObjectHelper.notNull("language", getLanguage());
                 Language language = camelContext.resolveLanguage(getLanguage());
+                if (language == null) {
+                    throw new NoSuchLanguageException(getLanguage());
+                }
                 String exp = getExpression();
                 // should be true by default
                 boolean isTrim = getTrim() == null || getTrim();
@@ -184,6 +188,9 @@ public class ExpressionDefinition implements Expression, Predicate, OtherAttribu
             } else if (getExpression() != null) {
                 ObjectHelper.notNull("language", getLanguage());
                 Language language = camelContext.resolveLanguage(getLanguage());
+                if (language == null) {
+                    throw new NoSuchLanguageException(getLanguage());
+                }
                 String exp = getExpression();
                 // should be true by default
                 boolean isTrim = getTrim() == null || getTrim();


Mime
View raw message