Skip to content

Commit 9908c39

Browse files
author
mylcode
committed
类型为NSNull的值不做处理
1 parent 4e2d245 commit 9908c39

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

MCJSONKit/Classes/NSObject+MCJSONKit.m

+4-3
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,12 @@ - (void)setValuesWithDictionary:(NSDictionary *)dict {
129129
设置属性值
130130
*/
131131
- (void)setValue:(id)value forProperty:(JSONCoreProperty *)property {
132+
if ([value isKindOfClass:[NSNull class]]) {
133+
//NSNull不做处理
134+
return;
135+
}
132136
if (value && property) {
133137
if (property.typeClass) {
134-
if ([value isKindOfClass:[NSNull class]]) {
135-
return;
136-
}
137138
if ([allowedJSONTypes containsObject:property.typeClass]) {
138139
//系统内置对象
139140
if ([value isKindOfClass:property.typeClass]) {

0 commit comments

Comments
 (0)