Adding check to _endBackgroundTask to verify the application exists before calling GWS_DNOT_REACHED.

This enables what is admittedly a rare scenario which is running these servers inside application-less unit tests where there is no UIApplication.
This commit is contained in:
Nick Gravelyn
2014-11-18 14:13:00 -08:00
parent 059f5c8d01
commit abb891334a
+1 -1
View File
@@ -283,7 +283,7 @@ static void _ExecuteMainThreadRunLoopSources() {
[[UIApplication sharedApplication] endBackgroundTask:_backgroundTask]; [[UIApplication sharedApplication] endBackgroundTask:_backgroundTask];
_backgroundTask = UIBackgroundTaskInvalid; _backgroundTask = UIBackgroundTaskInvalid;
GWS_LOG_DEBUG(@"Did end background task"); GWS_LOG_DEBUG(@"Did end background task");
} else { } else if ([UIApplication sharedApplication]) {
GWS_DNOT_REACHED(); GWS_DNOT_REACHED();
} }
} }