From 20de087441903780b4f27c6ab301a0454922e7f7 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 19 Sep 2018 12:14:15 -0400 Subject: [PATCH] Repair corrupt thread view. --- Signal/src/ViewControllers/HomeView/HomeViewController.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController.m b/Signal/src/ViewControllers/HomeView/HomeViewController.m index 4683a901b..cadb5dcb2 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewController.m @@ -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; }