lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aro...@apache.org
Subject svn commit: r568274 - /incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexReader.cs
Date Tue, 21 Aug 2007 20:51:03 GMT
Author: aroush
Date: Tue Aug 21 13:51:02 2007
New Revision: 568274

URL: http://svn.apache.org/viewvc?rev=568274&view=rev
Log:
Fix: LUCENENET-62 "IndexReader.IndexExists() Fails if directory doesn't exists."

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexReader.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexReader.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Index/IndexReader.cs?rev=568274&r1=568273&r2=568274&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexReader.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Index/IndexReader.cs Tue Aug 21 13:51:02
2007
@@ -405,7 +405,14 @@
 		
 		public static bool IndexExists(System.IO.FileInfo directory)
 		{
-			return SegmentInfos.GetCurrentSegmentGeneration(System.IO.Directory.GetFileSystemEntries(directory.FullName))
!= - 1;
+            if (System.IO.Directory.Exists(directory.FullName))
+            {
+                return SegmentInfos.GetCurrentSegmentGeneration(System.IO.Directory.GetFileSystemEntries(directory.FullName))
!= - 1;
+            }
+            else
+            {
+                return false;
+            }
 		}
 		
 		/// <summary> Returns <code>true</code> if an index exists at the specified
directory.



Mime
View raw message