Skip to content
This repository was archived by the owner on Jul 18, 2023. It is now read-only.

Commit b6bffb8

Browse files
committed
fix incorrect error reporting from Fast Sort check
1 parent f26005c commit b6bffb8

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Everything/EverythingAPI.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,13 @@ public List<SearchResult> Search(string keyWord, CancellationToken token, SortOp
123123
EverythingApiDllImport.Everything_SetSearchW(keyWord);
124124
EverythingApiDllImport.Everything_SetOffset(offset);
125125
EverythingApiDllImport.Everything_SetMax(maxCount);
126-
127-
if(!EverythingApiDllImport.Everything_IsFastSort(sortOption))
128-
{
126+
127+
var fastSortOptionEnabled = EverythingApiDllImport.Everything_IsFastSort(sortOption);
128+
CheckAndThrowExceptionOnError();
129+
130+
if(!fastSortOptionEnabled)
129131
throw new InvalidOperationException("The Sort Option is not Fast Sort, it may take a long time to finish the query");
130-
}
132+
131133
EverythingApiDllImport.Everything_SetSort(sortOption);
132134

133135
if (token.IsCancellationRequested)

0 commit comments

Comments
 (0)