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 @@ -35,17 +35,14 @@ function buildCurrentResource(getServe) {
35
35
36
36
function getCLS ( ) {
37
37
const resource = executionAsyncResource ( ) ;
38
- if ( resource === null || ! resource [ cls ] ) {
38
+ if ( ! resource [ cls ] ) {
39
39
return null ;
40
40
}
41
41
return resource [ cls ] . state ;
42
42
}
43
43
44
44
function setCLS ( state ) {
45
45
const resource = executionAsyncResource ( ) ;
46
- if ( resource === null ) {
47
- return ;
48
- }
49
46
if ( ! resource [ cls ] ) {
50
47
resource [ cls ] = { state } ;
51
48
} else {
@@ -116,11 +113,17 @@ function buildAsyncLocalStorage(getServe) {
116
113
117
114
function getCLS ( ) {
118
115
const store = asyncLocalStorage . getStore ( ) ;
116
+ if ( store === undefined ) {
117
+ return null ;
118
+ }
119
119
return store . state ;
120
120
}
121
121
122
122
function setCLS ( state ) {
123
123
const store = asyncLocalStorage . getStore ( ) ;
124
+ if ( store === undefined ) {
125
+ return ;
126
+ }
124
127
store . state = state ;
125
128
}
126
129
You can’t perform that action at this time.
0 commit comments