aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2017-06-07 17:58:16 +0200
committerMax <post@wickenrode.com>2017-06-07 17:58:16 +0200
commit38d40d03969967a186ec57f86cd257ff4dab9fd0 (patch)
treec88e9682da580baf3984959f6ab949d069a87f3c /Source
parente52546bccb26e1afc8207053cf260e37f2596c37 (diff)
downloadsequelpro-38d40d03969967a186ec57f86cd257ff4dab9fd0.tar.gz
sequelpro-38d40d03969967a186ec57f86cd257ff4dab9fd0.tar.bz2
sequelpro-38d40d03969967a186ec57f86cd257ff4dab9fd0.zip
Fix an issue that could cause Sequel Pro to become unusable when reloading a table when at the same time editing a cell with a value that is not valid (#2816)
Diffstat (limited to 'Source')
-rw-r--r--Source/SPTableContent.m23
1 files changed, 12 insertions, 11 deletions
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index aeac9bc4..48871c11 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -1323,20 +1323,21 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper
{
NSAutoreleasePool *reloadPool = [[NSAutoreleasePool alloc] init];
- // Check whether a save of the current row is required.
- if (![[self onMainThread] saveRowOnDeselect]) return;
+ // Check whether a save of the current row is required, abort if pending changes couldn't be saved.
+ if ([[self onMainThread] saveRowOnDeselect]) {
- // Save view details to restore safely if possible (except viewport, which will be
- // preserved automatically, and can then be scrolled as the table loads)
- [self storeCurrentDetailsForRestoration];
- [self setViewportToRestore:NSZeroRect];
+ // Save view details to restore safely if possible (except viewport, which will be
+ // preserved automatically, and can then be scrolled as the table loads)
+ [self storeCurrentDetailsForRestoration];
+ [self setViewportToRestore:NSZeroRect];
- // Clear the table data column cache and status (including counts)
- [tableDataInstance resetColumnData];
- [tableDataInstance resetStatusData];
+ // Clear the table data column cache and status (including counts)
+ [tableDataInstance resetColumnData];
+ [tableDataInstance resetStatusData];
- // Load the table's data
- [self loadTable:[tablesListInstance tableName]];
+ // Load the table's data
+ [self loadTable:[tablesListInstance tableName]];
+ }
[tableDocumentInstance endTask];