Skip to content

Commit

Permalink
fix: MacOS command line app crashes if Parse framework is installed i…
Browse files Browse the repository at this point in the history
…n `/Library/Frameworks/` (#1395)
  • Loading branch information
JohnCaccavale authored Jan 30, 2023
1 parent c4a71e2 commit 54bc6f3
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,21 @@ - (void)_registerSubclassesInLoadedBundle:(NSBundle *)bundle {
return;
}
// Filter out any system bundles
if ([bundle.bundlePath hasPrefix:@"/System/"] || [bundle.bundlePath hasPrefix:@"/Library/"] || [bundle.bundlePath rangeOfString:@"iPhoneSimulator.sdk"].location != NSNotFound) {
if ([bundle.bundlePath hasPrefix:@"/System/"] || [bundle.bundlePath rangeOfString:@"iPhoneSimulator.sdk"].location != NSNotFound) {
return;
}

// The Parse framework cannot be bundled with a macOS Command Line Application but needs to be
// external to the application. The preferred file system location is '/Library/Frameworks'
// and we don't want to filter out the Parse framework if it is installed there. See also:
// https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Tasks/InstallingFrameworks.html#//apple_ref/doc/uid/20002261-97286
if ([bundle.bundlePath hasPrefix:@"/Library/"]) {
if ([bundle.bundlePath hasPrefix:@"/Library/Frameworks/"] && [[bundle.bundlePath lastPathComponent] isEqualToString:@"Parse.framework"]) {
[self _registerSubclassesInBundle:bundle];
}
return;
}

[self _registerSubclassesInBundle:bundle];
}

Expand Down

0 comments on commit 54bc6f3

Please sign in to comment.