File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -37,17 +37,14 @@ function buildCurrentResource(getServe) {
3737
3838 function getCLS ( ) {
3939 const resource = executionAsyncResource ( ) ;
40- if ( resource === null || ! resource [ cls ] ) {
40+ if ( ! resource [ cls ] ) {
4141 return null ;
4242 }
4343 return resource [ cls ] . state ;
4444 }
4545
4646 function setCLS ( state ) {
4747 const resource = executionAsyncResource ( ) ;
48- if ( resource === null ) {
49- return ;
50- }
5148 if ( ! resource [ cls ] ) {
5249 resource [ cls ] = { state } ;
5350 } else {
@@ -118,11 +115,17 @@ function buildAsyncLocalStorage(getServe) {
118115
119116 function getCLS ( ) {
120117 const store = asyncLocalStorage . getStore ( ) ;
118+ if ( store === undefined ) {
119+ return null ;
120+ }
121121 return store . state ;
122122 }
123123
124124 function setCLS ( state ) {
125125 const store = asyncLocalStorage . getStore ( ) ;
126+ if ( store === undefined ) {
127+ return ;
128+ }
126129 store . state = state ;
127130 }
128131
You can’t perform that action at this time.
0 commit comments