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

Unified Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2628133003: [ios] Made goToItemAtIndex: safe for release builds. (Closed)
Patch Set: Fixed compilaiton Created 3 years, 11 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/web/web_state/ui/crw_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index cad77de2eb11302be05b37801c4e99696abf8b89..09afbce2b3a94cdc5497039a75ceda223667043a 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -2276,8 +2276,10 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
- (void)goToItemAtIndex:(int)index {
CRWSessionController* sessionController = self.sessionController;
NSArray* entries = sessionController.entries;
- DCHECK_LT(static_cast<NSUInteger>(index), entries.count);
- DCHECK_GE(index, 0);
+ if (index < 0 || index >= static_cast<int>(entries.count)) {
+ NOTREACHED();
+ return;
+ }
if (!_webStateImpl->IsShowingWebInterstitial())
[self recordStateInHistory];
« 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