Skip to content

Commit

Permalink
fix(gatsby): null check for context (#35096)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoopman committed Mar 11, 2022
1 parent 5852dc8 commit 46e2902
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/gatsby/src/schema/resolvers.ts
Expand Up @@ -676,7 +676,7 @@ export function wrappingResolver<TSource, TArgs>(
)
activity.start()
}
if (context.telemetryResolverTimings) {
if (context?.telemetryResolverTimings) {
time = process.hrtime.bigint()
}

Expand All @@ -687,7 +687,7 @@ export function wrappingResolver<TSource, TArgs>(
}

const endActivity = (): void => {
if (context.telemetryResolverTimings) {
if (context?.telemetryResolverTimings) {
context.telemetryResolverTimings.push({
name: `${info.parentType}.${info.fieldName}`,
duration: Number(process.hrtime.bigint() - time) / 1000 / 1000,
Expand Down

0 comments on commit 46e2902

Please sign in to comment.