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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java

Issue 2520443002: Make AllDismissedItem and Footer optional leaves. (Closed)
Patch Set: comments Created 4 years, 1 month 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
Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java
index 476980470ac5a0e0f50ccdb2d344406a4a3cfc2c..acb5ed2f8be35fd7e73f24ec7cdd126040586c4e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/InnerNode.java
@@ -19,6 +19,9 @@ public abstract class InnerNode extends ChildNode implements NodeParent {
protected abstract List<TreeNode> getChildren();
private int getChildIndexForPosition(int position) {
+ if (position < 0) {
+ throw new IndexOutOfBoundsException(Integer.toString(position));
+ }
List<TreeNode> children = getChildren();
int numItems = 0;
int numChildren = children.size();

Powered by Google App Engine
This is Rietveld 408576698