Skip to content

Commit

Permalink
Merge pull request #369 from InsertWittyName/NilErrorFix
Browse files Browse the repository at this point in the history
Fix crash if underlyingError parameter is nil.
  • Loading branch information
phatmann committed Apr 11, 2014
2 parents 3f9c203 + ccad533 commit 7379c21
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];
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 7379c21

Please sign in to comment.