Skip to content

Commit 5fb4b6a

Browse files
committed
Fix a warning
1 parent e59a705 commit 5fb4b6a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

QSMailMediator.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#import "QSMailMediator.h"
22

33
NSString *defaultMailClientID(){
4-
NSURL *appURL = nil;
5-
OSStatus err;
6-
err = LSGetApplicationForURL((CFURLRef)[NSURL URLWithString: @"mailto:"], kLSRolesAll, NULL, (CFURLRef *)&appURL);
7-
if (err != noErr) {
8-
NSLog(@"No default mail client found. Error %ld", (long)err);
4+
NSURL *appURL = [[NSWorkspace sharedWorkspace] URLForApplicationToOpenURL:[NSURL URLWithString:@"mailto:"]];
5+
if (!appURL) {
6+
NSLog(@"No default mail client found");
97
return nil;
108
}
119
NSDictionary *infoDict = (NSDictionary *)CFBundleCopyInfoDictionaryForURL((CFURLRef)appURL);

0 commit comments

Comments
 (0)