Handle case where it was an emptyList

This commit is contained in:
zzz
2016-11-13 16:11:19 +00:00
parent efd953f3d4
commit 75d599e061

View File

@ -56,7 +56,10 @@ public class NewsFeedHelper extends HelperBase {
if (init != null) {
// crude check to see if it's already in there
if (entries.size() != 1 || !DataHelper.eq(entries.get(0).title, init.title))
entries.add(init);
if (entries.isEmpty())
entries = Collections.singletonList(init); // in case it was an emtpyList
else
entries.add(init);
}
}
}