lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject lucenenet git commit: Fix NRE
Date Sun, 01 Feb 2015 12:56:16 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master 518b67620 -> 554d1ec11


Fix NRE


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

Branch: refs/heads/master
Commit: 554d1ec11d29e2a6c711ec748e3dca65baa23c90
Parents: 518b676
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Sun Feb 1 14:55:51 2015 +0200
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Sun Feb 1 14:55:51 2015 +0200

----------------------------------------------------------------------
 src/Lucene.Net.TestFramework/Search/AssertingQuery.cs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/554d1ec1/src/Lucene.Net.TestFramework/Search/AssertingQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Search/AssertingQuery.cs b/src/Lucene.Net.TestFramework/Search/AssertingQuery.cs
index bd2651c..ea7cdc5 100644
--- a/src/Lucene.Net.TestFramework/Search/AssertingQuery.cs
+++ b/src/Lucene.Net.TestFramework/Search/AssertingQuery.cs
@@ -46,7 +46,8 @@ namespace Lucene.Net.Search
         /// Wrap a query if necessary. </summary>
         public static Query Wrap(Random random, Query query)
         {
-            return query is AssertingQuery ? query : new AssertingQuery(random, query);
+            var aq = query as AssertingQuery;
+            return aq ?? new AssertingQuery(random, query);
         }
 
         public override Weight CreateWeight(IndexSearcher searcher)
@@ -105,7 +106,8 @@ namespace Lucene.Net.Search
             }
             set
             {
-                @in.Boost = value;
+                if (@in != null)
+                    @in.Boost = value;
             }
         }
     }


Mime
View raw message