| Index: chrome/browser/ui/webui/options/startup_pages_handler.cc
|
| diff --git a/chrome/browser/ui/webui/options/startup_pages_handler.cc b/chrome/browser/ui/webui/options/startup_pages_handler.cc
|
| index f58b6bc5c5df534719ff50f2e2a1da22c050fec3..343b2a68a6d775d6c1d28e576b9838ae0d3e3e8b 100644
|
| --- a/chrome/browser/ui/webui/options/startup_pages_handler.cc
|
| +++ b/chrome/browser/ui/webui/options/startup_pages_handler.cc
|
| @@ -151,13 +151,17 @@ void StartupPagesHandler::RemoveStartupPages(const ListValue* args) {
|
|
|
| void StartupPagesHandler::AddStartupPage(const ListValue* args) {
|
| std::string url_string;
|
| - CHECK_EQ(args->GetSize(), 1U);
|
| CHECK(args->GetString(0, &url_string));
|
|
|
| GURL url = URLFixerUpper::FixupURL(url_string, std::string());
|
| if (!url.is_valid())
|
| return;
|
| - int index = startup_custom_pages_table_model_->RowCount();
|
| +
|
| + int row_count = startup_custom_pages_table_model_->RowCount();
|
| + int index;
|
| + if (!args->GetInteger(1, &index) || index > row_count)
|
| + index = row_count;
|
| +
|
| startup_custom_pages_table_model_->Add(index, url);
|
| }
|
|
|
|
|