BUG: Fixed keynotfound exception in Lucene.Net.Core.Index.SegmentInfo.GetAttribute()
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/e70f4c7b Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/e70f4c7b Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/e70f4c7b Branch: refs/heads/api-work Commit: e70f4c7b686c80bff8468fd525da3e5e78f2941a Parents: e20befa Author: Shad Storhaug <[email protected]> Authored: Tue Feb 28 01:34:23 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Tue Feb 28 05:09:23 2017 +0700 ---------------------------------------------------------------------- src/Lucene.Net.Core/Index/SegmentInfo.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e70f4c7b/src/Lucene.Net.Core/Index/SegmentInfo.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Core/Index/SegmentInfo.cs b/src/Lucene.Net.Core/Index/SegmentInfo.cs index 00ad1f8..8a72c49 100644 --- a/src/Lucene.Net.Core/Index/SegmentInfo.cs +++ b/src/Lucene.Net.Core/Index/SegmentInfo.cs @@ -341,7 +341,9 @@ namespace Lucene.Net.Index } else { - return attributes[key]; + string attribute; + attributes.TryGetValue(key, out attribute); + return attribute; } }
