Permalink
Browse files

fix wraplist+pagecontrol crashes when wraplist has no items

closes #12134
  • Loading branch information...
1 parent 6744b62 commit c84b436126f3503804d732bf8aacae07eb0689a5 @pieh pieh committed Oct 26, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 xbmc/guilib/GUIWrappingListContainer.cpp
View
2 xbmc/guilib/GUIWrappingListContainer.cpp
@@ -41,7 +41,7 @@ void CGUIWrappingListContainer::UpdatePageControl(int offset)
{
if (m_pageControl)
{ // tell our pagecontrol (scrollbar or whatever) to update (offset it by our cursor position)
- CGUIMessage msg(GUI_MSG_ITEM_SELECT, GetID(), m_pageControl, CorrectOffset(offset, GetCursor()) % GetNumItems());
+ CGUIMessage msg(GUI_MSG_ITEM_SELECT, GetID(), m_pageControl, GetNumItems() ? CorrectOffset(offset, GetCursor()) % GetNumItems() : 0);
SendWindowMessage(msg);
}
}

0 comments on commit c84b436

Please sign in to comment.