File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -37,17 +37,14 @@ function buildCurrentResource(getServe) {
37
37
38
38
function getCLS ( ) {
39
39
const resource = executionAsyncResource ( ) ;
40
- if ( resource === null || ! resource [ cls ] ) {
40
+ if ( ! resource [ cls ] ) {
41
41
return null ;
42
42
}
43
43
return resource [ cls ] . state ;
44
44
}
45
45
46
46
function setCLS ( state ) {
47
47
const resource = executionAsyncResource ( ) ;
48
- if ( resource === null ) {
49
- return ;
50
- }
51
48
if ( ! resource [ cls ] ) {
52
49
resource [ cls ] = { state } ;
53
50
} else {
@@ -118,11 +115,17 @@ function buildAsyncLocalStorage(getServe) {
118
115
119
116
function getCLS ( ) {
120
117
const store = asyncLocalStorage . getStore ( ) ;
118
+ if ( store === undefined ) {
119
+ return null ;
120
+ }
121
121
return store . state ;
122
122
}
123
123
124
124
function setCLS ( state ) {
125
125
const store = asyncLocalStorage . getStore ( ) ;
126
+ if ( store === undefined ) {
127
+ return ;
128
+ }
126
129
store . state = state ;
127
130
}
128
131
You can’t perform that action at this time.
0 commit comments