Fix crash when searching for "from:me"

This commit is contained in:
Shadowfacts 2024-01-22 17:24:55 -05:00
parent bf27b8fd47
commit 5cef76e494
1 changed files with 1 additions and 1 deletions

View File

@ -88,7 +88,7 @@ class MastodonSearchController: UISearchController {
if searchText.isEmpty || "from:me".contains(searchText) {
fromSuggestions.append("from:me")
}
if searchText != "me",
if searchText != "me" && searchText != "from:me",
let match = acctRegex.firstMatch(in: searchText, range: NSRange(location: 0, length: searchText.utf16.count)) {
let matched = (searchText as NSString).substring(with: match.range)
fromSuggestions.append("from:\(matched)")