Browse Source

Cause a Crashlytics crash when either system or timezone date is nil.

Localization 1.1.1
Abhishek Banthia 9 years ago
parent
commit
140dd94213
  1. 24
      Clocker.xcodeproj/project.pbxproj
  2. BIN
      Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate
  3. 12
      Clocker/PanelController.m

24
Clocker.xcodeproj/project.pbxproj

@ -338,7 +338,7 @@
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application: Abhishek Banthia (AJS5SNW8EY)";
CODE_SIGN_IDENTITY = "Mac Developer: Abhishek Banthia (75WFZYE9LW)";
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
@ -354,7 +354,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.10;
PROVISIONING_PROFILE = "1885f3d2-2a35-4a0b-b465-4c0119f4bbaf";
PROVISIONING_PROFILE = "";
SDKROOT = macosx;
};
name = Distribution;
@ -365,7 +365,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_ENTITLEMENTS = Clocker/Clocker.entitlements;
CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application: Abhishek Banthia (AJS5SNW8EY)";
CODE_SIGN_IDENTITY = "Mac Developer: Abhishek Banthia (75WFZYE9LW)";
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -377,7 +377,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.10;
PRODUCT_BUNDLE_IDENTIFIER = com.abhishek.Clocker;
PRODUCT_NAME = Clocker;
PROVISIONING_PROFILE = "1885f3d2-2a35-4a0b-b465-4c0119f4bbaf";
PROVISIONING_PROFILE = "";
WRAPPER_EXTENSION = app;
};
name = Distribution;
@ -393,7 +393,7 @@
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application: Abhishek Banthia (AJS5SNW8EY)";
CODE_SIGN_IDENTITY = "Mac Developer: Abhishek Banthia (75WFZYE9LW)";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@ -417,7 +417,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.10;
ONLY_ACTIVE_ARCH = YES;
PROVISIONING_PROFILE = "1885f3d2-2a35-4a0b-b465-4c0119f4bbaf";
PROVISIONING_PROFILE = "";
SDKROOT = macosx;
};
name = Debug;
@ -433,7 +433,7 @@
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application: Abhishek Banthia (AJS5SNW8EY)";
CODE_SIGN_IDENTITY = "Mac Developer: Abhishek Banthia (75WFZYE9LW)";
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_STRICT_OBJC_MSGSEND = YES;
@ -449,7 +449,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.10;
PROVISIONING_PROFILE = "1885f3d2-2a35-4a0b-b465-4c0119f4bbaf";
PROVISIONING_PROFILE = "";
SDKROOT = macosx;
};
name = Release;
@ -460,7 +460,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_ENTITLEMENTS = Clocker/Clocker.entitlements;
CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application: Abhishek Banthia (AJS5SNW8EY)";
CODE_SIGN_IDENTITY = "Mac Developer: Abhishek Banthia (75WFZYE9LW)";
COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = (
@ -473,7 +473,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.10;
PRODUCT_BUNDLE_IDENTIFIER = com.abhishek.Clocker;
PRODUCT_NAME = Clocker;
PROVISIONING_PROFILE = "1885f3d2-2a35-4a0b-b465-4c0119f4bbaf";
PROVISIONING_PROFILE = "";
WRAPPER_EXTENSION = app;
};
name = Debug;
@ -484,7 +484,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_ENTITLEMENTS = Clocker/Clocker.entitlements;
CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application: Abhishek Banthia (AJS5SNW8EY)";
CODE_SIGN_IDENTITY = "Mac Developer: Abhishek Banthia (75WFZYE9LW)";
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -496,7 +496,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.10;
PRODUCT_BUNDLE_IDENTIFIER = com.abhishek.Clocker;
PRODUCT_NAME = Clocker;
PROVISIONING_PROFILE = "1885f3d2-2a35-4a0b-b465-4c0119f4bbaf";
PROVISIONING_PROFILE = "";
WRAPPER_EXTENSION = app;
};
name = Release;

BIN
Clocker.xcodeproj/project.xcworkspace/xcuserdata/abhishekbanthia.xcuserdatad/UserInterfaceState.xcuserstate generated

Binary file not shown.

12
Clocker/PanelController.m

@ -30,6 +30,7 @@
#import "BackgroundView.h"
#import "StatusItemView.h"
#import "MenubarController.h"
#import <Crashlytics/Crashlytics.h>
#define OPEN_DURATION .15
#define CLOSE_DURATION .1
@ -310,9 +311,6 @@
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.dateStyle = kCFDateFormatterShortStyle;
dateFormatter.timeStyle = kCFDateFormatterNoStyle;
dateFormatter.timeZone = [NSTimeZone systemTimeZone];
return [dateFormatter stringFromDate:currentDate];
@ -327,6 +325,14 @@
NSDate *localDate = [formatter dateFromString:systemDate];
NSDate *timezoneDate = [formatter dateFromString:date];
if (localDate == nil || timezoneDate == nil) {
[[Crashlytics sharedInstance] crash];
[CrashlyticsKit setUserEmail:systemDate];
[CrashlyticsKit setUserIdentifier:date];
NSLog(@"One of the dates is nil");
return @"Today";
}
// Specify which units we would like to use
unsigned units = NSCalendarUnitDay;
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];

Loading…
Cancel
Save