Repair corrupt thread view.

This commit is contained in:
Matthew Chen 2018-09-19 12:14:15 -04:00
parent a0a48431ca
commit 20de087441
1 changed files with 7 additions and 0 deletions

View File

@ -880,6 +880,13 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
withMappings:self.threadMappings];
}];
static BOOL hasIncrementedDatabaseView = NO;
if (![thread isKindOfClass:[TSThread class]] && !hasIncrementedDatabaseView) {
OWSLogError(@"Invalid object in thread view: %@", [thread class]);
[OWSStorage incrementVersionOfDatabaseExtension:TSThreadDatabaseViewExtensionName];
hasIncrementedDatabaseView = YES;
}
return thread;
}