File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,9 @@ pub fn create_list_table<T: Entity>(
50
50
}
51
51
}
52
52
}
53
- let id_column = table. get_column_mut ( 0 ) . unwrap ( ) ;
54
- id_column. set_constraint ( ColumnConstraint :: MinWidth ( ID_COLUMN_WIDTH ) ) ;
53
+ if let Some ( id_column) = table. get_column_mut ( 0 ) {
54
+ id_column. set_constraint ( ColumnConstraint :: MinWidth ( ID_COLUMN_WIDTH ) ) ;
55
+ }
55
56
table
56
57
}
57
58
@@ -555,6 +556,15 @@ mod tests {
555
556
) ;
556
557
}
557
558
559
+ #[ test]
560
+ fn test_create_list_table_no_header_no_data ( ) {
561
+ let data: Vec < Patient > = vec ! [ ] ;
562
+ assert_eq ! (
563
+ format_table( create_list_table( data, None , & PATIENTS_LIST_DICOM_TAGS ) ) ,
564
+ ""
565
+ ) ;
566
+ }
567
+
558
568
#[ test]
559
569
fn test_create_show_table_patient ( ) {
560
570
let patient = Patient {
You can’t perform that action at this time.
0 commit comments