mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-10 05:06:36 +02:00
adding checks
This commit is contained in:
@@ -29,16 +29,15 @@ namespace Wox.Plugin.Indexer.SearchHelper
|
|||||||
// execute the command, which returns the results as an OleDbDataReader.
|
// execute the command, which returns the results as an OleDbDataReader.
|
||||||
using (WDSResults = command.ExecuteReader())
|
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) };
|
var result = new SearchResult { Path = WDSResults.GetString(0) };
|
||||||
yield return result;
|
yield return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,6 +87,7 @@ namespace Wox.Plugin.Indexer.SearchHelper
|
|||||||
queryHelper.QuerySorting = "System.DateModified DESC";
|
queryHelper.QuerySorting = "System.DateModified DESC";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[STAThread]
|
||||||
public IEnumerable<SearchResult> Search(string keyword, string pattern = "*", int maxCount = 100)
|
public IEnumerable<SearchResult> Search(string keyword, string pattern = "*", int maxCount = 100)
|
||||||
{
|
{
|
||||||
ISearchQueryHelper queryHelper;
|
ISearchQueryHelper queryHelper;
|
||||||
|
|||||||
Reference in New Issue
Block a user