summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r--chrome/browser/ui/webui/ntp/app_launcher_handler.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
index a494a9c..893fb0b 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -173,8 +173,8 @@ void AppLauncherHandler::CreateAppInfo(const Extension* extension,
// We convert the page_ordinal to an integer because the pages are referenced
// from within an array in the javascript code, which can't be easily
// changed to handle the StringOrdinal values, so we do the conversion here.
- value->SetInteger("page_index",
- prefs->PageStringOrdinalAsInteger(page_ordinal));
+ int page_index = prefs->PageStringOrdinalAsInteger(page_ordinal);
+ value->SetInteger("page_index", page_index >= 0 ? page_index : 0);
StringOrdinal app_launch_ordinal =
prefs->GetAppLaunchOrdinal(extension->id());