Commit 42e91471 authored by Sky Malice's avatar Sky Malice Committed by Commit Bot

[Touchless] Guard against parsing null/empty strings.

Bug: 955174
Change-Id: Id6a01cb3f237a088add8062717d8354b77cefa52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1577932Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Sky Malice <skym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653579}
parent cf19a926
......@@ -622,7 +622,10 @@ public class NewTabPage implements NativePage, InvalidationAwareThumbnailProvide
if (tab.getWebContents() == null) return defaultValue;
String stringValue = getStringFromNavigationEntry(tab, key);
if (stringValue == null || stringValue.isEmpty()) {
return RecyclerView.NO_POSITION;
}
try {
return Integer.parseInt(stringValue);
} catch (NumberFormatException e) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment