Skip to content

Commit

Permalink
类型为NSNull的值不做处理
Browse files Browse the repository at this point in the history
  • Loading branch information
mylcode committed Feb 13, 2018
1 parent 4e2d245 commit 9908c39
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions MCJSONKit/Classes/NSObject+MCJSONKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,12 @@ - (void)setValuesWithDictionary:(NSDictionary *)dict {
设置属性值
*/
- (void)setValue:(id)value forProperty:(JSONCoreProperty *)property {
if ([value isKindOfClass:[NSNull class]]) {
//NSNull不做处理
return;
}
if (value && property) {
if (property.typeClass) {
if ([value isKindOfClass:[NSNull class]]) {
return;
}
if ([allowedJSONTypes containsObject:property.typeClass]) {
//系统内置对象
if ([value isKindOfClass:property.typeClass]) {
Expand Down

0 comments on commit 9908c39

Please sign in to comment.