We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 12809b3 commit aaae4abCopy full SHA for aaae4ab
packages/astro/src/server/middleware.ts
@@ -88,10 +88,12 @@ async function instrumentRequest(
88
): Promise<Response> {
89
// Make sure we don't accidentally double wrap (e.g. user added middleware and integration auto added it)
90
const locals = ctx.locals as AstroLocalsWithSentry | undefined;
91
- if (!locals || locals.__sentry_wrapped__) {
+ if (locals?.__sentry_wrapped__) {
92
return next();
93
}
94
- addNonEnumerableProperty(locals, '__sentry_wrapped__', true);
+ if (locals) {
95
+ addNonEnumerableProperty(locals, '__sentry_wrapped__', true);
96
+ }
97
98
const isDynamicPageRequest = checkIsDynamicPageRequest(ctx);
99
0 commit comments