If quincy.bundle is missing in the app, show a warning via NSLog and send crash reports without showing any dialogs, since it would crash otherwise

This commit is contained in:
Andreas Linde 2011-12-04 13:56:27 +01:00
parent 9415d921b6
commit dc631f4d7e

View File

@ -179,6 +179,10 @@ NSString *BWQuincyLocalize(NSString *stringToken) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(startManager) name:BWQuincyNetworkBecomeReachable object:nil];
}
if (!quincyBundle()) {
NSLog(@"WARNING: Quincy.bundle is missing in the app bundle!");
}
}
return self;
}
@ -251,7 +255,10 @@ NSString *BWQuincyLocalize(NSString *stringToken) {
- (void)startManager {
if (!_sendingInProgress && [self hasPendingCrashReport]) {
_sendingInProgress = YES;
if (!self.autoSubmitCrashReport && [self hasNonApprovedCrashReports]) {
if (!quincyBundle()) {
NSLog(@"Quincy.bundle is missing, sending report automatically!");
[self _sendCrashReports];
} else if (!self.autoSubmitCrashReport && [self hasNonApprovedCrashReports]) {
if (self.delegate != nil && [self.delegate respondsToSelector:@selector(willShowSubmitCrashReportAlert)]) {
[self.delegate willShowSubmitCrashReportAlert];
@ -323,7 +330,8 @@ NSString *BWQuincyLocalize(NSString *stringToken) {
UIAlertView *alertView = nil;
if (_serverResult >= CrashReportStatusAssigned &&
_crashIdenticalCurrentVersion) {
_crashIdenticalCurrentVersion &&
quincyBundle()) {
// show some feedback to the user about the crash status
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
switch (_serverResult) {
@ -459,7 +467,7 @@ NSString *BWQuincyLocalize(NSString *stringToken) {
NSString *contact = @"";
NSString *description = @"";
if (self.autoSubmitDeviceUDID) {
if (self.autoSubmitDeviceUDID && [[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"]) {
userid = [self deviceIdentifier];
} else if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashReportUserID)]) {
userid = [self.delegate crashReportUserID] ?: @"";