From 7cc751ff4f70766ea900ab774660a386d99d443e Mon Sep 17 00:00:00 2001 From: Zorg Date: Wed, 6 Sep 2023 21:05:59 -0700 Subject: [PATCH] Fail gracefully when auxiliary tool cannot be located (#2436) --- InstallerLauncher/SUInstallerLauncher.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/InstallerLauncher/SUInstallerLauncher.m b/InstallerLauncher/SUInstallerLauncher.m index 50d34f3e..f70fbe6d 100644 --- a/InstallerLauncher/SUInstallerLauncher.m +++ b/InstallerLauncher/SUInstallerLauncher.m @@ -326,10 +326,17 @@ } 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; }