File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ const Tracks: React.FC<TrackProps> = (props) => {
47
47
48
48
// ========================== Render ==========================
49
49
const tracksNode =
50
- classNames . tracks || styles . tracks ? (
50
+ trackList ?. length && ( classNames . tracks || styles . tracks ) ? (
51
51
< Track
52
52
index = { null }
53
53
prefixCls = { prefixCls }
Original file line number Diff line number Diff line change @@ -662,4 +662,10 @@ describe('Slider', () => {
662
662
const { asFragment } = render ( < Slider included = { false } /> ) ;
663
663
expect ( asFragment ( ) . firstChild ) . toMatchSnapshot ( ) ;
664
664
} ) ;
665
+
666
+ it ( 'tipFormatter should not crash with undefined value' , ( ) => {
667
+ [ undefined , null ] . forEach ( ( value ) => {
668
+ render ( < Slider value = { value } tooltip = { { open : true } } styles = { { tracks : { } } } /> ) ;
669
+ } ) ;
670
+ } ) ;
665
671
} ) ;
You can’t perform that action at this time.
0 commit comments