diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 29a7d1bc9..9237050b1 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -622,9 +622,14 @@ CComponentsItem* CComponentsForm::getSelectedItemObject() void CComponentsForm::ScrollPage(int direction, bool do_paint) { + if (getPageCount() == 1){ + cur_page = 0; + return; + } + OnBeforeScrollPage(); - int target_page_id = (int)getPageCount() - 1; + int target_page_id = (int)page_count - 1; int target_page = (int)cur_page; if (direction == SCROLL_P_DOWN)