We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d3fe4a3 + 21065dc commit 7bd8ac5Copy full SHA for 7bd8ac5
Terminal Notifier/AppDelegate.m
@@ -205,10 +205,12 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification;
205
206
- (NSImage*)getImageFromURL:(NSString *) url;
207
{
208
- if(!contains(url, @"file://")){ // Prefix file:// if not present
+ NSURL *imageURL = [NSURL URLWithString:url];
209
+ if([[imageURL scheme] length] == 0){
210
+ // Prefix 'file://' if no scheme
211
url = [NSString stringWithFormat:@"%@%@", @"file://", url];
212
+ imageURL = [NSURL URLWithString:url];
213
}
- NSURL *imageURL = [NSURL URLWithString:url];
214
return [[NSImage alloc] initWithContentsOfURL:imageURL];
215
216
0 commit comments