Fix crash related to BulkDownloadFragment's creation
During the initialization phase in the adapter we are checking if the
activity is non null and is in foreground, otherwise convertView is not
created causing a null pointer during population phase of the adapter.
@@ -224,7 +224,7 @@ public class CourseOutlineAdapter extends BaseAdapter {
return getLastAccessedView(position, convertView);
}
case SectionRow.BULK_DOWNLOAD: {
- if (rootComponent != null) {
+ if (rootComponent != null && convertView != null) {
final BulkDownloadFragment fragment = (BulkDownloadFragment) convertView.getTag();
fragment.populateViewHolder(
isOnCourseOutline ? rootComponent.getCourseId() : rootComponent.getId(),
