aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPUserManager.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2013-03-07 01:29:19 +0000
committerrowanbeentje <rowan@beent.je>2013-03-07 01:29:19 +0000
commit2a7c3296a7186558446d136d4c87633126561371 (patch)
tree0466e2d5c60bca04dd8c82eaec1cc70498cc0227 /Source/SPUserManager.m
parent1ebe3e3b0c5fc9ea248dfd4a678d3166d5e62c78 (diff)
downloadsequelpro-2a7c3296a7186558446d136d4c87633126561371.tar.gz
sequelpro-2a7c3296a7186558446d136d4c87633126561371.tar.bz2
sequelpro-2a7c3296a7186558446d136d4c87633126561371.zip
- Fix crashes in the User Manager when fields don't validate but a save/cancel/tab switch is still triggered, addressing Issue #1627
Diffstat (limited to 'Source/SPUserManager.m')
-rw-r--r--Source/SPUserManager.m9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m
index 8b7a3f33..eb69203a 100644
--- a/Source/SPUserManager.m
+++ b/Source/SPUserManager.m
@@ -464,6 +464,9 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn";
*/
- (IBAction)doCancel:(id)sender
{
+ // Discard any pending changes
+ [treeController discardEditing];
+
// Change the first responder to end editing in any field
[[self window] makeFirstResponder:self];
@@ -479,6 +482,12 @@ static const NSString *SPTableViewNameColumnID = @"NameColumn";
*/
- (IBAction)doApply:(id)sender
{
+
+ // If editing can't be committed, cancel the apply
+ if (![treeController commitEditing]) {
+ return;
+ }
+
errorsString = [[NSMutableString alloc] init];
// Change the first responder to end editing in any field