mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Adds guard against empty search strings to Find in Article
This commit is contained in:
@@ -709,6 +709,7 @@ internal struct FindInArticleState: Codable {
|
||||
}
|
||||
|
||||
extension WebViewController {
|
||||
|
||||
func searchText(_ searchText: String, completionHandler: @escaping (FindInArticleState) -> Void) {
|
||||
guard let json = try? JSONEncoder().encode(FindInArticleOptions(text: searchText)) else {
|
||||
return
|
||||
|
||||
@@ -429,6 +429,11 @@ updateFind = withEncodedArg(options => {
|
||||
// TODO Introduce slight delay, cap the number of results, and report results asynchronously
|
||||
|
||||
let newFindState;
|
||||
if (!options || !options.text) {
|
||||
clearHighlightRects();
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
newFindState = new FindState(options);
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user