Fixed bug raising exception when loaderForObject: is invoked with a method of RKRequestMethodInvalid. fixes #601

This commit is contained in:
Blake Watters
2012-03-19 16:03:25 -04:00
parent 868372272f
commit b0ab880868
3 changed files with 21 additions and 3 deletions

View File

@@ -258,6 +258,7 @@
}
- (RKObjectMappingDefinition *)mappingForPatternMatchingString:(NSString *)string context:(RKObjectMappingProviderContext)context {
NSAssert(string, @"Cannot look up mapping matching nil pattern string.");
RKOrderedDictionary *contextValue = [self valueForContext:context];
NSAssert(contextValue, @"Attempted to retrieve mapping from undefined context: %d", context);
for (NSString *pattern in contextValue) {