File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,8 @@ const _apiProps = {
50
50
return new ( Promise ) ( resolve => { this . one ( '_onFlushEffects' , function ( ) { resolve . apply ( this , arguments ) ; } ) ; } ) ;
51
51
} ,
52
52
select : function ( id = missingParamEr ( 'select' ) ) {
53
- id = id + '' ; //make sure id is string
53
+ if ( id )
54
+ id = id + '' ; //make sure id is string
54
55
const result = this . _getOnChangePromise ( ) ;
55
56
this . _select ( id ) ;
56
57
return result ;
@@ -84,7 +85,8 @@ const _apiProps = {
84
85
return this ;
85
86
} ,
86
87
open : function ( tabObj = missingParamEr ( 'open' ) ) {
87
- tabObj . id = tabObj . id + '' ; //make sure id is string
88
+ if ( tabObj . id )
89
+ tabObj . id = tabObj . id + '' ; //make sure id is string
88
90
const result = this . _getOnChangePromise ( ) ;
89
91
this . _open ( tabObj . id ) ;
90
92
this . _addTab ( tabObj , { defaultPanelComponent : this . getOption ( 'defaultPanelComponent' ) } ) ;
@@ -97,7 +99,8 @@ const _apiProps = {
97
99
return result ;
98
100
} ,
99
101
close : function ( id = missingParamEr ( 'close' ) ) {
100
- id = id + '' ; //make sure id is string
102
+ if ( id )
103
+ id = id + '' ; //make sure id is string
101
104
if ( this . isSelected ( id ) ) {
102
105
const _openTabsId = [ ...this . stateRef . openTabIDs ] ;
103
106
_openTabsId . splice ( _openTabsId . indexOf ( id ) , 1 ) ;
You can’t perform that action at this time.
0 commit comments