diff --git a/Sources/KSCrashFilters/KSCrashReportFilterBasic.m b/Sources/KSCrashFilters/KSCrashReportFilterBasic.m index e36f88eb0..7c50f6394 100644 --- a/Sources/KSCrashFilters/KSCrashReportFilterBasic.m +++ b/Sources/KSCrashFilters/KSCrashReportFilterBasic.m @@ -278,15 +278,14 @@ - (instancetype) initWithFiltersArray:(NSArray*) filters [expandedFilters addObject:filter]; } } - self.filters = expandedFilters; + self.filters = [expandedFilters copy]; } return self; } - (void) addFilter:(id) filter { - NSMutableArray* mutableFilters = (NSMutableArray*)self.filters; // Shh! Don't tell anyone! - [mutableFilters insertObject:filter atIndex:0]; + self.filters = [@[filter] arrayByAddingObjectsFromArray:self.filters]; } - (void) filterReports:(NSArray*) reports diff --git a/Sources/KSCrashInstallations/include/KSCrashInstallation.h b/Sources/KSCrashInstallations/include/KSCrashInstallation.h index afc3241e6..eecb18363 100644 --- a/Sources/KSCrashInstallations/include/KSCrashInstallation.h +++ b/Sources/KSCrashInstallations/include/KSCrashInstallation.h @@ -62,7 +62,7 @@ NS_SWIFT_NAME(Installation) * when using this method. The callback will be internally managed to ensure proper integration * with the backend. */ -- (void) installWithConfiguration:(KSCrashConfiguration*) configuration; +- (void) installWithConfiguration:(nullable KSCrashConfiguration*) configuration; /** Convenience method to call -[KSCrash sendAllReportsWithCompletion:]. * This method will set the KSCrash sink and then send all outstanding reports. diff --git a/Sources/KSCrashInstallations/include/KSCrashInstallationQuincyHockey.h b/Sources/KSCrashInstallations/include/KSCrashInstallationQuincyHockey.h index e773d16b1..59519055b 100644 --- a/Sources/KSCrashInstallations/include/KSCrashInstallationQuincyHockey.h +++ b/Sources/KSCrashInstallations/include/KSCrashInstallationQuincyHockey.h @@ -85,10 +85,10 @@ NS_SWIFT_NAME(InstallationBaseQuincyHockey) // The above properties will be written to the user section report using the // following keys. -@property(nonatomic,readwrite,copy) NSString* userIDKey; -@property(nonatomic,readwrite,copy) NSString* userNameKey; -@property(nonatomic,readwrite,copy) NSString* contactEmailKey; -@property(nonatomic,readwrite,copy) NSString* crashDescriptionKey; +@property(nonatomic,readwrite,copy,nullable) NSString* userIDKey; +@property(nonatomic,readwrite,copy,nullable) NSString* userNameKey; +@property(nonatomic,readwrite,copy,nullable) NSString* contactEmailKey; +@property(nonatomic,readwrite,copy,nullable) NSString* crashDescriptionKey; /** Data stored under these keys will be appended to the description * (in JSON format) before sending to Quincy/Hockey. diff --git a/Sources/KSCrashInstallations/include/KSCrashInstallationVictory.h b/Sources/KSCrashInstallations/include/KSCrashInstallationVictory.h index 4f6b0fe6c..2c7dbf649 100644 --- a/Sources/KSCrashInstallations/include/KSCrashInstallationVictory.h +++ b/Sources/KSCrashInstallations/include/KSCrashInstallationVictory.h @@ -45,7 +45,7 @@ NS_SWIFT_NAME(InstallationVictory) /** The URL to connect to. */ @property(nonatomic,readwrite,strong) NSURL* url; /** The user name of crash information *required*. If value is nil it will be replaced with UIDevice.currentDevice.name */ -@property(nonatomic,readwrite,copy) NSString* userName; +@property(nonatomic,readwrite,copy,nullable) NSString* userName; /** The user email of crash information *optional* */ @property(nonatomic,readwrite,copy,nullable) NSString* userEmail; diff --git a/Tests/KSCrashInstallationsTests/KSCrashInstallationEmail_Tests.m b/Tests/KSCrashInstallationsTests/KSCrashInstallationEmail_Tests.m index c87bcff9a..5c59ee0db 100644 --- a/Tests/KSCrashInstallationsTests/KSCrashInstallationEmail_Tests.m +++ b/Tests/KSCrashInstallationsTests/KSCrashInstallationEmail_Tests.m @@ -56,10 +56,13 @@ - (void) testInstall - (void) testInstallInvalid { KSCrashInstallationEmail* installation = [KSCrashInstallationEmail sharedInstance]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnonnull" installation.recipients = nil; installation.subject = nil; installation.message = nil; installation.filenameFmt = nil; +#pragma clang diagnostic pop [installation addUnconditionalAlertWithTitle:@"title" message:@"message" dismissButtonText:@"dismiss"]; [installation installWithConfiguration:nil]; [installation sendAllReportsWithCompletion:^(__unused NSArray *filteredReports, BOOL completed, NSError *error) diff --git a/Tests/KSCrashInstallationsTests/KSCrashInstallationQuincyHockey_Tests.m b/Tests/KSCrashInstallationsTests/KSCrashInstallationQuincyHockey_Tests.m index c21e12e82..408afd598 100644 --- a/Tests/KSCrashInstallationsTests/KSCrashInstallationQuincyHockey_Tests.m +++ b/Tests/KSCrashInstallationsTests/KSCrashInstallationQuincyHockey_Tests.m @@ -60,7 +60,10 @@ - (void) testQuincyInstall - (void) testQuincyInstallMissingProperties { KSCrashInstallationQuincy* installation = [KSCrashInstallationQuincy sharedInstance]; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnonnull" installation.url = nil; +#pragma clang diagnostic pop [installation installWithConfiguration:nil]; [installation sendAllReportsWithCompletion:^(__unused NSArray *filteredReports, BOOL completed, NSError *error) {