mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-18 06:29:44 +08:00
adding checks
This commit is contained in:
parent
4b08c0b56b
commit
c1b3686190
@ -29,16 +29,15 @@ namespace Wox.Plugin.Indexer.SearchHelper
|
||||
// execute the command, which returns the results as an OleDbDataReader.
|
||||
using (WDSResults = command.ExecuteReader())
|
||||
{
|
||||
while (WDSResults.Read())
|
||||
if(WDSResults.HasRows)
|
||||
{
|
||||
if (!Convert.IsDBNull(WDSResults[0]))
|
||||
while (WDSResults.Read() && WDSResults.GetValue(0) != DBNull.Value)
|
||||
{
|
||||
var result = new SearchResult { Path = WDSResults.GetString(0) };
|
||||
yield return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -88,6 +87,7 @@ namespace Wox.Plugin.Indexer.SearchHelper
|
||||
queryHelper.QuerySorting = "System.DateModified DESC";
|
||||
}
|
||||
|
||||
[STAThread]
|
||||
public IEnumerable<SearchResult> Search(string keyword, string pattern = "*", int maxCount = 100)
|
||||
{
|
||||
ISearchQueryHelper queryHelper;
|
||||
|
Loading…
Reference in New Issue
Block a user