BUG: Lucene.Net.Expressions.JS.JavascriptCompiler: Fixed KeyNotFoundException 
in RecursiveCompile()


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

Branch: refs/heads/api-work
Commit: cce0f0838818c5bf969a497856d7576209e22cf7
Parents: c1d5328
Author: Shad Storhaug <[email protected]>
Authored: Sun Mar 5 09:59:39 2017 +0700
Committer: Shad Storhaug <[email protected]>
Committed: Sun Mar 5 17:08:49 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Expressions/JS/JavascriptCompiler.cs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cce0f083/src/Lucene.Net.Expressions/JS/JavascriptCompiler.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Expressions/JS/JavascriptCompiler.cs 
b/src/Lucene.Net.Expressions/JS/JavascriptCompiler.cs
index 15d0de2..0580e83 100644
--- a/src/Lucene.Net.Expressions/JS/JavascriptCompiler.cs
+++ b/src/Lucene.Net.Expressions/JS/JavascriptCompiler.cs
@@ -247,8 +247,8 @@ namespace Lucene.Net.Expressions.JS
                         ITree identifier = current.GetChild(0);
                         string call = identifier.Text;
                         int arguments = current.ChildCount - 1;
-                        MethodInfo method = functions[call];
-                        if (method == null)
+                        MethodInfo method;
+                        if (!functions.TryGetValue(call, out method) || method 
== null)
                         {
                             throw new ArgumentException("Unrecognized method 
call (" + call + ").");
                         }

Reply via email to