Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #20 from wordpress-mobile/invalid-dates

Ignore invalid/null dates
  • Loading branch information...
commit 18c723821abbd76b5a701bb19f67d5b6e8592f33 2 parents f9b7685 + d46a6a5
@eczarny authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 XMLRPCEventBasedParserDelegate.m
View
10 XMLRPCEventBasedParserDelegate.m
@@ -267,7 +267,11 @@ - (void)addElementValueToParent {
break;
case XMLRPCElementTypeDictionary:
- [parentElementValue setObject: myElementValue forKey: myElementKey];
+ if ([myElementValue isEqual:[NSNull null]]) {
+ [parentElementValue removeObjectForKey:myElementKey];
+ } else {
+ [parentElementValue setObject: myElementValue forKey: myElementKey];
+ }
break;
case XMLRPCElementTypeMember:
@@ -329,6 +333,10 @@ - (NSDate *)parseDate: (NSString *)value {
result = [self parseDateString: value withFormat: @"yyyy'-'MM'-'dd'T'HH:mm:ss"];
}
+ if (!result) {
+ result = (NSDate *)[NSNull null];
+ }
+
return result;
}
Please sign in to comment.
Something went wrong with that request. Please try again.