aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPConnectionController.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-05-02 14:12:07 +0000
committerstuconnolly <stuart02@gmail.com>2012-05-02 14:12:07 +0000
commit10e797436aac4a33e1bee046be07286a5d6eb22a (patch)
tree0f66b64e068b6c7e3e2b64ff56792c94e00ecfdc /Source/SPConnectionController.m
parent316e515bdb2144a193abdd973730b1e3c200b2c7 (diff)
downloadsequelpro-10e797436aac4a33e1bee046be07286a5d6eb22a.tar.gz
sequelpro-10e797436aac4a33e1bee046be07286a5d6eb22a.tar.bz2
sequelpro-10e797436aac4a33e1bee046be07286a5d6eb22a.zip
Prevent connection initialization when there's no favorite selected.
Diffstat (limited to 'Source/SPConnectionController.m')
-rw-r--r--Source/SPConnectionController.m18
1 files changed, 10 insertions, 8 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index ee3c74bc..f5929ff6 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -270,19 +270,21 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2,
#pragma mark Interface interaction
/**
- * Registered in initWithDocument: to be the double click action of the favorites outline view.
+ * Registered to be the double click action of the favorites outline view.
*/
- (IBAction)nodeDoubleClicked:(id)sender
{
SPTreeNode *node = [self selectedFavoriteNode];
- // Only proceed to initiate a connection if a leaf node (i.e. a favorite and not a group) was double clicked.
- if (![node isGroup]) {
- [self initiateConnection:self];
- }
- // Otherwise start editing the group node's name
- else {
- [favoritesOutlineView editColumn:0 row:[favoritesOutlineView selectedRow] withEvent:nil select:YES];
+ if (node) {
+ // Only proceed to initiate a connection if a leaf node (i.e. a favorite and not a group) was double clicked.
+ if (![node isGroup]) {
+ [self initiateConnection:self];
+ }
+ // Otherwise start editing the group node's name
+ else {
+ [favoritesOutlineView editColumn:0 row:[favoritesOutlineView selectedRow] withEvent:nil select:YES];
+ }
}
}