skip authors if no one presented

This commit is contained in:
Ekaterina Tuzova
2015-08-24 20:48:57 +03:00
parent b4dfdf3b6c
commit 4e4726a03d
@@ -84,7 +84,8 @@ public class Course {
this.authors = new ArrayList<CourseInfo.Author>();
for (String name : authors) {
final List<String> pair = StringUtil.split(name, " ");
this.authors.add(new CourseInfo.Author(pair.get(0), pair.size() > 1 ? pair.get(1) : ""));
if (!pair.isEmpty())
this.authors.add(new CourseInfo.Author(pair.get(0), pair.size() > 1 ? pair.get(1) : ""));
}
}