From a8f05eda2fc4bb2d776b99f8a4b1ec1afe146ccf Mon Sep 17 00:00:00 2001 From: Sveinbjorn Thordarson Date: Sat, 30 Mar 2019 13:03:46 +0000 Subject: [PATCH] Fixed crash bug when bundle path lookup for app failed. Updated docs etc. for release 2.8.1. --- README.md | 8 ++++++-- resources/Info.plist | 2 +- source/Common.h | 2 +- source/ProcessUtils.m | 3 +++ source/SlothController.m | 5 ++++- sparkle/SlothAppcast.xml | 6 +++--- 6 files changed, 18 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 41bb86e..9cbc3c7 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,9 @@ Sloth is free, open source software and has been developed and maintained for a ## Download -* **[⇩ Download Sloth 2.8](https://sveinbjorn.org/files/software/sloth.zip)** (~0.7 MB, Intel 64-bit, macOS 10.8 or later) +* **[⇩ Download Sloth 2.8.1](https://sveinbjorn.org/files/software/sloth.zip)** (~0.7 MB, Intel 64-bit, macOS 10.8 or later) -Sloth can also be installed via [Homebrew](https://brew.sh): +Sloth can also be installed via [Homebrew](https://brew.sh) (may not be latest version): ```shell $ brew cask install sloth @@ -37,6 +37,10 @@ $ brew cask install sloth ## Version history +### 30/03/2019 - Version 2.8.1 + +* Fixed potential crash bug introduced in version 2.8. + ### 27/03/2019 - Version 2.8 * New Dark Mode friendly template icons for Mojave diff --git a/resources/Info.plist b/resources/Info.plist index 8b0440d..4f56dfe 100644 --- a/resources/Info.plist +++ b/resources/Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleShortVersionString - 2.8 + 2.8.1 CFBundleVersion 1 LSApplicationCategoryType diff --git a/source/Common.h b/source/Common.h index 84b611b..9b297b1 100644 --- a/source/Common.h +++ b/source/Common.h @@ -29,7 +29,7 @@ */ #define PROGRAM_NAME @"Sloth" -#define PROGRAM_VERSION @"2.8" +#define PROGRAM_VERSION @"2.8.1" #define PROGRAM_WEBSITE @"https://sveinbjorn.org/sloth" #define PROGRAM_GITHUB_WEBSITE @"https://github.com/sveinbjornt/Sloth" #define PROGRAM_DONATIONS @"https://sveinbjorn.org/donations" diff --git a/source/ProcessUtils.m b/source/ProcessUtils.m index 4d28f98..74f0df8 100644 --- a/source/ProcessUtils.m +++ b/source/ProcessUtils.m @@ -46,6 +46,9 @@ + (NSRunningApplication *)appForPID:(pid_t)pid { } + (BOOL)isAppProcess:(NSString *)bundlePath { + if (!bundlePath) { + return NO; + } NSString *fileType = [[NSWorkspace sharedWorkspace] typeOfFile:bundlePath error:nil]; return ([[NSWorkspace sharedWorkspace] type:fileType conformsToType:@"com.apple.application"]); } diff --git a/source/SlothController.m b/source/SlothController.m index 562345c..d4aa5da 100644 --- a/source/SlothController.m +++ b/source/SlothController.m @@ -574,7 +574,10 @@ - (void)updateProcessInfo:(NSMutableDictionary *)p { if (app) { p[@"bundle"] = @YES; - p[@"path"] = [[app bundleURL] path]; + NSString *bundlePath = [[app bundleURL] path]; + if (bundlePath) { + p[@"path"] = bundlePath; + } p[@"image"] = [WORKSPACE iconForFile:p[@"path"]]; p[@"app"] = @([ProcessUtils isAppProcess:p[@"path"]]); } else { diff --git a/sparkle/SlothAppcast.xml b/sparkle/SlothAppcast.xml index ef14388..1f91583 100644 --- a/sparkle/SlothAppcast.xml +++ b/sparkle/SlothAppcast.xml @@ -7,9 +7,9 @@ en - Version 2.8 - Wednesday, 27 Mar 2019 22:01:00 +0000 - + Version 2.8.1 + Saturday, 30 Mar 2019 13:06:00 +0000 + 10.8.0 New in Sloth 2.8