From c27e06e95d403f6100b4386487a83a466cf696bc Mon Sep 17 00:00:00 2001 From: Bibiko Date: Wed, 19 Jan 2011 14:21:24 +0000 Subject: =?UTF-8?q?=E2=80=A2=20fixed=20NSLocalizedString=20error=20while?= =?UTF-8?q?=20compiling=20(genstring)=20in=20MGTemplateEngine.m=20-=20comm?= =?UTF-8?q?ent=20shouldn't=20be=20nil?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/MGTemplateEngine.m | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'Source') diff --git a/Source/MGTemplateEngine.m b/Source/MGTemplateEngine.m index 86068b66..89ea3a1d 100644 --- a/Source/MGTemplateEngine.m +++ b/Source/MGTemplateEngine.m @@ -177,10 +177,16 @@ - (void)reportError:(NSString *)errorStr code:(NSInteger)code continuing:(BOOL)continuing { if (delegate) { - NSString *errStr = NSLocalizedString(errorStr, nil); - if (!continuing) { - errStr = [NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"Fatal Error", nil), errStr]; - } + + NSString *errStr; + if(errorStr) + errStr = [NSString stringWithString:errorStr]; + else + errStr = NSLocalizedString(@"MGTemplateEngine Error", @"mgtemplateengine error"); + + if (!continuing) + errStr = [NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"Fatal Error", @"fatal error"), errStr]; + SEL selector = @selector(templateEngine:encounteredError:isContinuing:); if ([(NSObject *)delegate respondsToSelector:selector]) { NSError *error = [NSError errorWithDomain:TEMPLATE_ENGINE_ERROR_DOMAIN -- cgit v1.2.3