Fix crash when getting account relationship fails

UIDeferredMenuElement completion handler should only be called from the
main thread
This commit is contained in:
Shadowfacts 2021-08-12 19:41:00 -04:00
parent 85e1e131f6
commit 99e06441f0
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 3 additions and 1 deletions

View File

@ -67,7 +67,9 @@ extension MenuPreviewProvider {
guard let self = self, guard let self = self,
case let .success(results, _) = response, case let .success(results, _) = response,
let relationship = results.first else { let relationship = results.first else {
DispatchQueue.main.async {
elementHandler([]) elementHandler([])
}
return return
} }
let following = relationship.following let following = relationship.following