mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
NSWorkspace: Throw a descriptive exception when make_services could not be found (#208)
`[NSTask launchPathForTool: @"make_services"]; can return nil when the tool is not found. In this case, [NSTask launchedTaskWithLaunchPath] would raise a NSInvalidArgumentException with error message "NSTask - no launch path set" which is not very descriptive.
This commit is contained in:
parent
8619fe33c2
commit
31a71a1090
1 changed files with 7 additions and 0 deletions
|
@ -1746,6 +1746,13 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
|||
{
|
||||
path = [[NSTask launchPathForTool: @"make_services"] retain];
|
||||
}
|
||||
|
||||
if (path == nil)
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"Unable to find the make_services tool.\n"];
|
||||
}
|
||||
|
||||
task = [NSTask launchedTaskWithLaunchPath: path
|
||||
arguments: nil];
|
||||
if (task != nil)
|
||||
|
|
Loading…
Reference in a new issue