Skip to content

Commit

Permalink
Update configuration error checking (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjenkins authored Mar 6, 2019
1 parent 8532ea7 commit 5f66ce0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions mParticle-Appboy/MPKitAppboy.m
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,17 @@ - (void)start {
[serverKeys enumerateObjectsUsingBlock:^(NSString * _Nonnull serverKey, NSUInteger idx, BOOL * _Nonnull stop) {
NSString *optionValue = self.configuration[serverKey];

if (optionValue) {
if (optionValue != nil && (NSNull *)optionValue != [NSNull null]) {
NSString *appboyKey = appboyKeys[idx];
optionsDictionary[appboyKey] = [numberFormatter numberFromString:optionValue];
NSNumber *numberValue = nil;
@try {
numberValue = [numberFormatter numberFromString:optionValue];
} @catch (NSException *exception) {
numberValue = nil;
}
if (numberValue != nil) {
optionsDictionary[appboyKey] = numberValue;
}
}
}];

Expand Down

0 comments on commit 5f66ce0

Please sign in to comment.