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

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..3fa9c8ec0eae4d99efa85b62447e8c97ab9c9a12 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) {
lpromero 2017/05/03 10:05:57 Isn't it "if (!item)"? Please also change the des
jlebel 2017/05/03 11:05:01 Done.
+ // 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