Skip to content

Commit

Permalink
Fail gracefully when auxiliary tool cannot be located (#2436)
Browse files Browse the repository at this point in the history
  • Loading branch information
zorgiepoo committed Sep 7, 2023
1 parent d005af3 commit 7cc751f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions InstallerLauncher/SUInstallerLauncher.m
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,17 @@ - (NSString *)pathForBundledTool:(NSString *)toolName extension:(NSString *)exte
} else {
auxiliaryToolURL = [bundle URLForAuxiliaryExecutable:nameWithExtension];
}
assert(auxiliaryToolURL != nil);

if (auxiliaryToolURL == nil) {
SULog(SULogLevelError, @"Error: Cannot retrieve path for auxiliary tool: %@", nameWithExtension);
return nil;
}

NSURL *resolvedAuxiliaryToolURL = [auxiliaryToolURL URLByResolvingSymlinksInPath];
assert(resolvedAuxiliaryToolURL != nil);
if (resolvedAuxiliaryToolURL == nil) {
SULog(SULogLevelError, @"Error: Cannot retrieve resolved path for auxiliary tool path: %@", auxiliaryToolURL.path);
return nil;
}

return resolvedAuxiliaryToolURL.path;
}
Expand Down

0 comments on commit 7cc751f

Please sign in to comment.