aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableSource.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/TableSource.m')
-rw-r--r--Source/TableSource.m24
1 files changed, 12 insertions, 12 deletions
diff --git a/Source/TableSource.m b/Source/TableSource.m
index 8ccc682e..83e3dde1 100644
--- a/Source/TableSource.m
+++ b/Source/TableSource.m
@@ -75,15 +75,15 @@
// If an error occurred, reset the interface and abort
if ([mySQLConnection queryErrored]) {
- NSString *errorMessage = [NSString stringWithString:[mySQLConnection getLastErrorMessage]];
-
[[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance];
[[self onMainThread] setTableDetails:nil];
- SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"),
- nil, nil, [NSApp mainWindow], self, nil, nil, nil,
- [NSString stringWithFormat:NSLocalizedString(@"An error occurred while retrieving information.\nMySQL said: %@", @"message of panel when retrieving information failed"),
- errorMessage]);
+ if ([mySQLConnection isConnected]) {
+ SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"),
+ nil, nil, [NSApp mainWindow], self, nil, nil, nil,
+ [NSString stringWithFormat:NSLocalizedString(@"An error occurred while retrieving information.\nMySQL said: %@", @"message of panel when retrieving information failed"),
+ [mySQLConnection getLastErrorMessage]]);
+ }
if (tableSourceResult) [tableSourceResult release];
return;
}
@@ -97,15 +97,15 @@
// If an error occurred, reset the interface and abort
if ([mySQLConnection queryErrored]) {
- NSString *errorMessage = [NSString stringWithString:[mySQLConnection getLastErrorMessage]];
-
[[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryHasBeenPerformed" object:tableDocumentInstance];
[[self onMainThread] setTableDetails:nil];
- SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"),
- nil, nil, [NSApp mainWindow], self, nil, nil, nil,
- [NSString stringWithFormat:NSLocalizedString(@"An error occurred while retrieving information.\nMySQL said: %@", @"message of panel when retrieving information failed"),
- errorMessage]);
+ if ([mySQLConnection isConnected]) {
+ SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"),
+ nil, nil, [NSApp mainWindow], self, nil, nil, nil,
+ [NSString stringWithFormat:NSLocalizedString(@"An error occurred while retrieving information.\nMySQL said: %@", @"message of panel when retrieving information failed"),
+ [mySQLConnection getLastErrorMessage]]);
+ }
if (indexResult) [indexResult release];
return;
}