From 24a6b69ed8e79a3890d4a29d713bc9cb73e9c0d9 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Thu, 30 Jul 2020 12:19:42 +1000 Subject: [PATCH] Fix UI code invoked from background thread --- Signal/src/util/MainAppContext.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Signal/src/util/MainAppContext.m b/Signal/src/util/MainAppContext.m index 9790ae493..e367efa31 100644 --- a/Signal/src/util/MainAppContext.m +++ b/Signal/src/util/MainAppContext.m @@ -157,6 +157,7 @@ NSString *const ReportedApplicationStateDidChangeNotification = @"ReportedApplic - (BOOL)isMainAppAndActive { + if (![NSThread isMainThread]) { return NO; } return [UIApplication sharedApplication].applicationState == UIApplicationStateActive; }