Skip to content

Commit e12e3e8

Browse files
committed
Fix one cause a popular crash involving alert dialogs (part of #2297)
1 parent 747f03c commit e12e3e8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Source/SPTableContent.m

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -985,12 +985,13 @@ - (void) loadTableValues
985985
#ifndef SP_CODA
986986
if(activeFilter == 0) {
987987
#endif
988+
NSString *errorDetail;
988989
if(filterString)
989-
SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil,
990-
[NSString stringWithFormat:NSLocalizedString(@"The table data couldn't be loaded presumably due to used filter clause. \n\nMySQL said: %@", @"message of panel when loading of table failed and presumably due to used filter argument"), [mySQLConnection lastErrorMessage]]);
990+
errorDetail = [NSString stringWithFormat:NSLocalizedString(@"The table data couldn't be loaded presumably due to used filter clause. \n\nMySQL said: %@", @"message of panel when loading of table failed and presumably due to used filter argument"), [mySQLConnection lastErrorMessage]];
991991
else
992-
SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, [tableDocumentInstance parentWindow], self, nil, nil,
993-
[NSString stringWithFormat:NSLocalizedString(@"The table data couldn't be loaded.\n\nMySQL said: %@", @"message of panel when loading of table failed"), [mySQLConnection lastErrorMessage]]);
992+
errorDetail = [NSString stringWithFormat:NSLocalizedString(@"The table data couldn't be loaded.\n\nMySQL said: %@", @"message of panel when loading of table failed"), [mySQLConnection lastErrorMessage]];
993+
994+
SPOnewayAlertSheet(NSLocalizedString(@"Error", @"error"), nil, [tableDocumentInstance parentWindow], errorDetail, NSWarningAlertStyle);
994995
}
995996
#ifndef SP_CODA
996997
// Filter task came from filter table

0 commit comments

Comments
 (0)