Skip to content

Commit

Permalink
handle empty reply from bitly
Browse files Browse the repository at this point in the history
  • Loading branch information
labria committed Apr 28, 2009
1 parent 527b8d5 commit fb3c27d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions AppDelegate.m
Expand Up @@ -37,8 +37,12 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
BitLyParser * parser = [BitLyParser newWithURLFromString:[clip string_]];
[parser getData];
NSString * result = [parser parseXML];
[growl_ growlString:result];
[clip_ setData:result];
if (result == nil) {
[growl_ growlString:@"No url in reply"];
} else {
[growl_ growlString:result];
[clip_ setData:result];
}
}

[NSApp terminate:self];
Expand Down Expand Up @@ -72,8 +76,12 @@ - (void)shortenURL:(NSPasteboard *)pboard
BitLyParser * parser = [BitLyParser newWithURLFromString:pboardString];
[parser getData];
NSString * result = [parser parseXML];
[clip_ setData:result];
[growl_ growlString:result];
if (result == nil) {
[growl_ growlString:@"No url in reply"];
} else {
[growl_ growlString:result];
[clip_ setData:result];
}
}
[NSApp terminate:self];
}
Expand Down
2 changes: 1 addition & 1 deletion Info.plist
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.4</string>
<string>0.6</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
Expand Down

0 comments on commit fb3c27d

Please sign in to comment.