Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Unified Diff: ios/chrome/browser/ui/settings/sync_settings_collection_view_controller.mm

Issue 2854303003: Don't crash when having an update from an unknown identity (Closed)
Patch Set: :( Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/settings/sync_settings_collection_view_controller.mm
diff --git a/ios/chrome/browser/ui/settings/sync_settings_collection_view_controller.mm b/ios/chrome/browser/ui/settings/sync_settings_collection_view_controller.mm
index 0632a09b8558ae51d52bbdb29207a196537b345e..eb123e3879c06e36e7e9dfa3b4d7816770416163 100644
--- a/ios/chrome/browser/ui/settings/sync_settings_collection_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/sync_settings_collection_view_controller.mm
@@ -964,6 +964,10 @@ typedef NS_ENUM(NSInteger, ItemType) {
CollectionViewAccountItem* item =
base::mac::ObjCCastStrict<CollectionViewAccountItem>(
[_identityMap objectForKey:identity.gaiaID]);
+ if (!item) {
+ // Ignoring unknown identity.
+ return;
+ }
[self updateAccountItem:item withIdentity:identity];
[self reconfigureCellsForItems:@[ item ]
inSectionWithIdentifier:SectionIdentifierSyncAccounts];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698