| Index: ui/app_list/pagination_model.cc
|
| diff --git a/ui/app_list/pagination_model.cc b/ui/app_list/pagination_model.cc
|
| index 02a4179d2193281c7e87176d6fcd480015a92697..5e8d655a37580f5458b6b924b8fe09221412927d 100644
|
| --- a/ui/app_list/pagination_model.cc
|
| +++ b/ui/app_list/pagination_model.cc
|
| @@ -32,7 +32,7 @@ void PaginationModel::SetTotalPages(int total_pages) {
|
| if (selected_page_ < 0)
|
| SelectPage(0, false /* animate */);
|
| if (selected_page_ >= total_pages_)
|
| - SelectPage(total_pages_ - 1, false /* animate */);
|
| + SelectPage(std::max(total_pages_ - 1, 0), false /* animate */);
|
| FOR_EACH_OBSERVER(PaginationModelObserver, observers_, TotalPagesChanged());
|
| }
|
|
|
| @@ -82,7 +82,7 @@ void PaginationModel::SelectPage(int page, bool animate) {
|
| }
|
| }
|
| } else {
|
| - DCHECK(page >= 0 && page < total_pages_);
|
| + DCHECK(total_pages_ == 0 || (page >= 0 && page < total_pages_));
|
|
|
| if (page == selected_page_)
|
| return;
|
|
|