Skipping any bundles we cannot name correctly

This commit is contained in:
Michael Starke
2014-08-17 01:12:08 +02:00
parent 030d97f4fc
commit 1a8419d8df

View File

@@ -86,6 +86,9 @@
for(NSString *bundleIdentifier in [self _bundleIdentifierForHTTPS]) {
NSString *bundlePath = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:bundleIdentifier];
NSString *browserName = [[NSFileManager defaultManager] displayNameAtPath:bundlePath];
if(nil == bundlePath || nil == browserName) {
continue; // Skip missing Applications
}
NSMenuItem *browserItem = [[NSMenuItem alloc] initWithTitle:browserName action:@selector(selectBrowser:) keyEquivalent:@""];
[browserItem setRepresentedObject:bundleIdentifier];
[browserItem setTarget:self];