Skip to content

Commit

Permalink
Only fill out the error if one doesn’t already exist
Browse files Browse the repository at this point in the history
  • Loading branch information
davedelong committed Jan 4, 2014
1 parent 400517b commit b40e3ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DDMathParser/DDMathEvaluator.m
Expand Up @@ -126,7 +126,7 @@ - (DDExpression *)resolveFunction:(_DDFunctionExpression *)functionExpression va
e = function([functionExpression arguments], variables, self, error);
}

if (e == nil && error != nil) {
if (e == nil && error != nil && *error == nil) {
*error = [NSError errorWithDomain:DDMathParserErrorDomain
code:DDErrorCodeUnresolvedFunction
userInfo:@{NSLocalizedDescriptionKey: [NSString stringWithFormat:@"unable to resolve function: %@", functionName],
Expand Down

0 comments on commit b40e3ca

Please sign in to comment.