Skip to content

Commit

Permalink
Merge pull request #688 from Sequel-Ace/tableChanged-crash
Browse files Browse the repository at this point in the history
#fixed - tableChanged NSNull Collation crash
  • Loading branch information
jamesstout committed Dec 24, 2020
2 parents 013c0f9 + af911ef commit 07b2d48
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Source/Controllers/SubviewControllers/SPTableInfo.m
Expand Up @@ -196,8 +196,20 @@ - (void)tableChanged:(NSNotification *)notification
[info addObject:[NSString stringWithFormat:NSLocalizedString(@"size: %@", @"Table Info Section : table size on disk"), [NSString stringForByteSize:[[tableStatus objectForKey:@"Data_length"] longLongValue]]]];
}

if([[tableStatus objectForKey:@"Collation"] isNSNull]){
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: @"tableStatus Collation is NSNull" ,
@"serverVersion" : tableDocumentInstance.mySQLVersion,
};

[FIRCrashlytics.crashlytics recordError:[NSError errorWithDomain:@"database" code:4 userInfo:userInfo]];
}

SPLog(@"tableStatus: %@", tableStatus);
CLS_LOG(@"tableStatus: %@", tableStatus);

NSString *tableEnc = [tableDataInstance tableEncoding];
NSString *tableColl = [tableStatus objectForKey:@"Collation"];
NSString *tableColl = [tableStatus safeObjectForKey:@"Collation"];

if([tableColl length]) {
// instead of @"latin1 (latin1_german_ci)" we can just show @"latin1 (german_ci)"
Expand Down

0 comments on commit 07b2d48

Please sign in to comment.