File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ The targeting mechanism uses the `exampleTargetingContextAccessor` to extract th
4141const exampleTargetingContextAccessor = {
4242 getTargetingContext: () => {
4343 const req = requestAccessor.getStore ();
44+ if (req === undefined) {
45+ return undefined;
46+ }
4447 // read user and groups from request query data
4548 const { userId, groups } = req.query;
4649 // return aa ITargetingContext with the appropriate user info
Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ const requestAccessor = new AsyncLocalStorage();
1515const exampleTargetingContextAccessor = {
1616 getTargetingContext : ( ) => {
1717 const req = requestAccessor . getStore ( ) ;
18+ if ( req === undefined ) {
19+ return undefined ;
20+ }
1821 // read user and groups from request query data
1922 const { userId, groups } = req . query ;
2023 // return an ITargetingContext with the appropriate user info
You can’t perform that action at this time.
0 commit comments