aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPCopyTable.m
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-06-12 00:01:01 +0200
committerMax <post@wickenrode.com>2015-06-17 11:53:08 +0200
commit3d8accc866c35c41717188f933d77f48c708a69f (patch)
tree3088c9f164f0eec86c62cb6f1351ad3e601e156b /Source/SPCopyTable.m
parentf12f9ce2853145ddcede5e4aef5511f9380d740f (diff)
downloadsequelpro-3d8accc866c35c41717188f933d77f48c708a69f.tar.gz
sequelpro-3d8accc866c35c41717188f933d77f48c708a69f.tar.bz2
sequelpro-3d8accc866c35c41717188f933d77f48c708a69f.zip
Fix a popular exception when a user tried to edit a field with a lost connection and then chose "disconnect" when Sequel Pro asks to reconnect (attempt at #2137)
Diffstat (limited to 'Source/SPCopyTable.m')
-rw-r--r--Source/SPCopyTable.m5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m
index 2b5554b5..439ff84d 100644
--- a/Source/SPCopyTable.m
+++ b/Source/SPCopyTable.m
@@ -495,8 +495,9 @@ static const NSInteger kBlobAsImageFile = 4;
// If the data is not loaded, attempt to fetch the value
if ([cellData isSPNotLoaded] && [[self delegate] isKindOfClass:spTableContentClass]) {
+ NSString *whereArgument = [tableInstance argumentForRow:rowIndex];
// Abort if no table name given, not table content, or if there are no indices on this table
- if (!selectedTable || ![[self delegate] isKindOfClass:spTableContentClass] || ![(NSString*)[tableInstance argumentForRow:rowIndex] length]) {
+ if (!selectedTable || ![[self delegate] isKindOfClass:spTableContentClass] || ![whereArgument length]) {
NSBeep();
free(columnMappings);
free(columnTypes);
@@ -509,7 +510,7 @@ static const NSInteger kBlobAsImageFile = 4;
[NSString stringWithFormat:@"SELECT %@ FROM %@ WHERE %@",
[NSArrayObjectAtIndex(tbHeader, columnMappings[c]) backtickQuotedString],
[selectedTable backtickQuotedString],
- [tableInstance argumentForRow:rowIndex]]];
+ whereArgument]];
}
// Check for NULL value