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 @@ -35,17 +35,14 @@ function buildCurrentResource(getServe) {
3535
3636 function getCLS ( ) {
3737 const resource = executionAsyncResource ( ) ;
38- if ( resource === null || ! resource [ cls ] ) {
38+ if ( ! resource [ cls ] ) {
3939 return null ;
4040 }
4141 return resource [ cls ] . state ;
4242 }
4343
4444 function setCLS ( state ) {
4545 const resource = executionAsyncResource ( ) ;
46- if ( resource === null ) {
47- return ;
48- }
4946 if ( ! resource [ cls ] ) {
5047 resource [ cls ] = { state } ;
5148 } else {
@@ -116,11 +113,17 @@ function buildAsyncLocalStorage(getServe) {
116113
117114 function getCLS ( ) {
118115 const store = asyncLocalStorage . getStore ( ) ;
116+ if ( store === undefined ) {
117+ return null ;
118+ }
119119 return store . state ;
120120 }
121121
122122 function setCLS ( state ) {
123123 const store = asyncLocalStorage . getStore ( ) ;
124+ if ( store === undefined ) {
125+ return ;
126+ }
124127 store . state = state ;
125128 }
126129
You can’t perform that action at this time.
0 commit comments