Skip to content

Commit

Permalink
Fix crash if underlyingError parameter is nil.
Browse files Browse the repository at this point in the history
  • Loading branch information
dave-perry committed Apr 10, 2014
1 parent c21433d commit ccad533
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Additions/NSError-KIFAdditions.m
Expand Up @@ -31,7 +31,9 @@ + (instancetype)KIFErrorWithUnderlyingError:(NSError *)underlyingError format:(N
NSString *description = [[[NSString alloc] initWithFormat:format arguments:args] autorelease];
va_end(args);

return [self errorWithDomain:@"KIFTest" code:KIFTestStepResultFailure userInfo:@{NSLocalizedDescriptionKey: description, NSUnderlyingErrorKey: underlyingError}];
NSDictionary *userInfo = [[NSDictionary alloc] initWithObjectsAndKeys:description, NSLocalizedDescriptionKey, underlyingError, NSUnderlyingErrorKey, nil];

return [self errorWithDomain:@"KIFTest" code:KIFTestStepResultFailure userInfo:userInfo];
}

@end

0 comments on commit ccad533

Please sign in to comment.