lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [29/50] [abbrv] lucenenet git commit: BUG: Lucene.Net.Facet.Taxonomy.Directory.DirectoryTaxonomyWriter: Fixed KeyNotFound exception
Date Tue, 31 Jan 2017 17:56:02 GMT
BUG: Lucene.Net.Facet.Taxonomy.Directory.DirectoryTaxonomyWriter: Fixed KeyNotFound exception


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

Branch: refs/heads/api-work
Commit: 368e3f03a1c0a4c77fbf0b6b4a11af757752caac
Parents: 4d8491a
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Tue Jan 31 16:01:24 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Tue Jan 31 16:01:24 2017 +0700

----------------------------------------------------------------------
 .../Taxonomy/Directory/DirectoryTaxonomyWriter.cs              | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/368e3f03/src/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyWriter.cs b/src/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyWriter.cs
index e30a488..94b323e 100644
--- a/src/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyWriter.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/Directory/DirectoryTaxonomyWriter.cs
@@ -717,8 +717,10 @@ namespace Lucene.Net.Facet.Taxonomy.Directory
             {
                 EnsureOpen();
                 // LUCENE-4972: if we always call setCommitData, we create empty commits
-                string epochStr = indexWriter.CommitData[INDEX_EPOCH];
-                if (epochStr == null || Convert.ToInt64(epochStr, 16) != indexEpoch)
+                string epochStr;
+                if (!indexWriter.CommitData.TryGetValue(INDEX_EPOCH, out epochStr) 
+                    || epochStr == null 
+                    || Convert.ToInt64(epochStr, 16) != indexEpoch)
                 {
                     indexWriter.CommitData = CombinedCommitData(indexWriter.CommitData);
                 }


Mime
View raw message