From bf2497087ed223ba27bb0c30226d6e46c8d734e8 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Fri, 17 Aug 2007 20:15:33 +0000 Subject: [PATCH] Give error instead of throw exception if Vim exe is not in app bundle. git-svn-id: http://macvim.googlecode.com/svn/trunk@153 96c4425d-ca35-0410-94e5-3396d5c13a8f --- MMAppController.m | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/MMAppController.m b/MMAppController.m index 573b12e057..41a90d9b8b 100644 --- a/MMAppController.m +++ b/MMAppController.m @@ -154,6 +154,7 @@ [alert runModal]; [alert release]; + [NSApp replyToOpenOrPrint:NSApplicationDelegateReplyFailure]; return; } @@ -162,6 +163,11 @@ NSString *path = [[NSBundle mainBundle] pathForAuxiliaryExecutable:@"Vim"]; + if (!path) { + NSLog(@"ERROR: Vim executable could not be found inside app bundle!"); + [NSApp replyToOpenOrPrint:NSApplicationDelegateReplyFailure]; + return; + } [NSTask launchedTaskWithLaunchPath:path arguments:args]; @@ -287,6 +293,11 @@ NSMutableArray *args = [NSMutableArray arrayWithObject:@"-g"]; NSString *path = [[NSBundle mainBundle] pathForAuxiliaryExecutable:@"Vim"]; + if (!path) { + NSLog(@"ERROR: Vim executable could not be found inside app bundle!"); + return; + } + //NSLog(@"Launching a new VimTask..."); [NSTask launchedTaskWithLaunchPath:path arguments:args];