Make sure a log message appears in the console if the SDK is not setup on the main thread

This commit is contained in:
Andreas Linde
2014-01-24 14:11:41 +01:00
parent 66c84630ea
commit 7086153d46

View File

@@ -503,12 +503,13 @@
#endif /* HOCKEYSDK_FEATURE_UPDATES */
- (BOOL)isSetUpOnMainThread {
NSString *errorString = @"ERROR: This SDK has to be setup on the main thread!";
NSString *errorString = @"ERROR: HockeySDK has to be setup on the main thread!";
if (!NSThread.isMainThread) {
if (self.isAppStoreEnvironment) {
BITHockeyLog(@"%@", errorString);
} else {
NSLog(@"%@", errorString);
NSAssert(NSThread.isMainThread, errorString);
}