Skip to content

Commit

Permalink
Making useSendTelemetry resilient against missing context.
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisoelkers committed Jul 15, 2024
1 parent 05423d8 commit bc51841
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const useSendTelemetry = () => {

return useCallback((eventType: TelemetryEventType, event: Optional<TelemetryEvent, 'app_path_pattern'>) => {
if (!dataRouterContext?.router?.routes) {
throw new Error('Data router context is missing!');
return () => {};
}

const { router: { routes } } = dataRouterContext;
Expand Down

0 comments on commit bc51841

Please sign in to comment.