File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 11Pod ::Spec . new do |s |
22 s . name = "MJExtension"
3- s . version = "3.0.4 "
3+ s . version = "3.0.5 "
44 s . ios . deployment_target = '6.0'
55 s . osx . deployment_target = '10.8'
66 s . summary = "A fast and convenient conversion between JSON and model"
Original file line number Diff line number Diff line change @@ -15,7 +15,10 @@ - (id)valueInObject:(id)object
1515 if ([object isKindOfClass: [NSDictionary class ]] && self.type == MJPropertyKeyTypeDictionary) {
1616 return object[self .name];
1717 } else if ([object isKindOfClass: [NSArray class ]] && self.type == MJPropertyKeyTypeArray) {
18- return ((NSArray *)object).count ? object[self .name.intValue] : nil ;
18+ NSArray *array = object;
19+ NSUInteger index = self.name .intValue ;
20+ if (index < array.count ) return array[index];
21+ return nil ;
1922 }
2023 return nil ;
2124}
Original file line number Diff line number Diff line change @@ -352,9 +352,10 @@ - (NSMutableDictionary *)mj_keyValuesWithKeys:(NSArray *)keys ignoredKeys:(NSArr
352352 }
353353
354354 if ([tempInnerContainer isKindOfClass: [NSMutableArray class ]]) {
355+ NSMutableArray *tempInnerContainerArray = tempInnerContainer;
355356 int index = nextPropertyKey.name .intValue ;
356- while ([tempInnerContainer count ] < index + 1 ) {
357- [tempInnerContainer addObject: [NSNull null ]];
357+ while (tempInnerContainerArray. count < index + 1 ) {
358+ [tempInnerContainerArray addObject: [NSNull null ]];
358359 }
359360 }
360361
You can’t perform that action at this time.
0 commit comments