Skip to content

Commit

Permalink
Added extra check to interger mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 6, 2024
1 parent 7d61198 commit 28d5655
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Qonversion/Qonversion/Mappers/QNMapper/QNMapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,13 @@ + (QNMapperObject *)mapperObjectFrom:(NSDictionary *)dict {
}

+ (NSInteger)mapInteger:(NSObject *)object orReturn:(NSInteger)defaultValue {
if (object == nil) {
if (!object) {
return defaultValue;
}

NSNumber *numberObject = (NSNumber *)object;

if ([numberObject isEqual:[NSNull null]]) {
if ([numberObject isEqual:[NSNull null]] || ![numberObject respondsToSelector:@selector(integerValue)]) {
return defaultValue;
} else {
return numberObject.integerValue;
Expand Down

0 comments on commit 28d5655

Please sign in to comment.