Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

GroupUtils: grouping an empty list is not an error

  • Loading branch information...
commit 743d237fb10aa245eb2bb7a937b5d750f2d46fba 1 parent 0c04283
@Montellese Montellese authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 xbmc/utils/GroupUtils.cpp
View
6 xbmc/utils/GroupUtils.cpp
@@ -36,9 +36,13 @@ typedef map<int, set<CFileItemPtr> > SetMap;
bool GroupUtils::Group(GroupBy groupBy, const std::string &baseDir, const CFileItemList &items, CFileItemList &groupedItems, GroupAttribute groupAttributes /* = GroupAttributeNone */)
{
- if (items.Size() <= 0 || groupBy == GroupByNone)
+ if (groupBy == GroupByNone)
return false;
+ // nothing to do if there are no items to group
+ if (items.Size() <= 0)
+ return true;
+
SetMap setMap;
for (int index = 0; index < items.Size(); index++)
{
Please sign in to comment.
Something went wrong with that request. Please try again.