Emit internal error for empty list.
dm_list_iterate_items(fp, &rh->field_props) {
if (fp->flags & FLD_HIDDEN) {
dm_list_iterate_items(row, &rh->rows) {
+ if (dm_list_empty(&row->fields))
+ continue;
field = dm_list_item(dm_list_first(&row->fields), struct dm_report_field);
dm_list_del(&field->list);
}
if (seg_is_mirrored(seg) && seg->area_count && seg_type(seg, 0) == AREA_LV) {
last_lvseg = dm_list_item(dm_list_last(&seg_lv(seg, 0)->segments), struct lv_segment);
- if (seg_is_striped(last_lvseg))
+ if (last_lvseg && seg_is_striped(last_lvseg))
return last_lvseg->area_count;
}
dm_list_iterate_items(fp, &rh->field_props) {
if (fp->flags & FLD_HIDDEN) {
dm_list_iterate_items(row, &rh->rows) {
+ if (dm_list_empty(&row->fields))
+ continue;
field = dm_list_item(dm_list_first(&row->fields), struct dm_report_field);
dm_list_del(&field->list);
}
int is_lockd;
int ret = 0;
+ if (dm_list_empty(&lr->poll_idls)) {
+ log_error(INTERNAL_ERROR "Cannot detach writecache.");
+ return 0;
+ }
+
idl = dm_list_item(dm_list_first(&lr->poll_idls), struct convert_poll_id_list);
id = idl->id;
is_lockd = lvmcache_vg_is_lockd_type(cmd, id->vg_name, NULL);