Skip to content

Commit

Permalink
Guard against edge case NPE in async tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Jan 27, 2022
1 parent 0f98138 commit 154e92e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/react-devtools-shared/src/backend/profilingHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,13 +639,17 @@ export function createProfilingHooks({
suspenseEvent.duration = getRelativeTime() - suspenseEvent.timestamp;
suspenseEvent.resolution = 'resolved';

markAndClear(`--suspense-resolved-${id}-${componentName}`);
if (supportsUserTimingV3) {
markAndClear(`--suspense-resolved-${id}-${componentName}`);
}
},
() => {
suspenseEvent.duration = getRelativeTime() - suspenseEvent.timestamp;
suspenseEvent.resolution = 'rejected';

markAndClear(`--suspense-rejected-${id}-${componentName}`);
if (supportsUserTimingV3) {
markAndClear(`--suspense-rejected-${id}-${componentName}`);
}
},
);
}
Expand Down

0 comments on commit 154e92e

Please sign in to comment.