diff options
author | Max <post@wickenrode.com> | 2017-05-17 23:44:35 +0200 |
---|---|---|
committer | Max <post@wickenrode.com> | 2017-05-17 23:47:43 +0200 |
commit | 43926b0d48a341335538bb7b368c3fa4a73ddadb (patch) | |
tree | 9a06796e158f6ec0b2d4dd8073d31936af5e1b74 /Source | |
parent | 8fcdb7bcc6dedb7af9b1a7829a83cdc2fca54f4b (diff) | |
download | sequelpro-43926b0d48a341335538bb7b368c3fa4a73ddadb.tar.gz sequelpro-43926b0d48a341335538bb7b368c3fa4a73ddadb.tar.bz2 sequelpro-43926b0d48a341335538bb7b368c3fa4a73ddadb.zip |
Add a check for table comment being NULL
(which can’t normally happen with MySQL, but I guess not every installation out there is normal) (#2791)
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPExtendedTableInfo.m | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m index df084bf3..dc311bdf 100644 --- a/Source/SPExtendedTableInfo.m +++ b/Source/SPExtendedTableInfo.m @@ -404,7 +404,8 @@ static NSString *SPMySQLCommentField = @"Comment"; [tableSizeFree setStringValue:[self _formatValueWithKey:SPMySQLDataFreeField inDictionary:statusFields]]; // Set comments - NSString *commentText = [statusFields objectForKey:SPMySQLCommentField]; + // Note: On MySQL the comment column is marked as NOT NULL, but we still received crash reports because it was NULL!? (#2791) + NSString *commentText = [[statusFields objectForKey:SPMySQLCommentField] unboxNull]; if (!commentText) commentText = @""; @@ -541,7 +542,7 @@ static NSString *SPMySQLCommentField = @"Comment"; if ((object == tableCommentsTextView) && ([object isEditable]) && ([selectedTable length] > 0)) { - NSString *currentComment = [[tableDataInstance statusValueForKey:@"Comment"] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + NSString *currentComment = [[[tableDataInstance statusValueForKey:SPMySQLCommentField] unboxNull] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSString *newComment = [[tableCommentsTextView string] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; // Check that the user actually changed the tables comment |