@@ -25,7 +25,8 @@ public static function getSubscribedEvents(): array
2525
2626 public function onRender (StorefrontRenderEvent $ event ): void
2727 {
28- if ($ this ->sentryOptions ->getDsn () == null
28+ if ($ this ->sentryOptions ->getDsn () === null
29+ || !$ this ->container ->hasParameter ('frosh_sentry.storefront.enabled ' )
2930 || !$ this ->container ->getParameter ('frosh_sentry.storefront.enabled ' )
3031 ) {
3132 return ;
@@ -36,8 +37,10 @@ public function onRender(StorefrontRenderEvent $event): void
3637 return ;
3738 }
3839
39- $ isReplayRecordingEnabled = $ this ->container ->getParameter ('frosh_sentry.storefront.replay_recording.enabled ' );
40- $ isPerformanceTracingEnabled = $ this ->container ->getParameter ('frosh_sentry.storefront.tracing.enabled ' ) === true ;
40+ $ isReplayRecordingEnabled = $ this ->container ->hasParameter ('frosh_sentry.storefront.replay_recording.enabled ' )
41+ && $ this ->container ->getParameter ('frosh_sentry.storefront.replay_recording.enabled ' ) === true ;
42+ $ isPerformanceTracingEnabled = $ this ->container ->hasParameter ('frosh_sentry.storefront.tracing.enabled ' )
43+ && $ this ->container ->getParameter ('frosh_sentry.storefront.tracing.enabled ' ) === true ;
4144
4245 if ($ isReplayRecordingEnabled && $ isPerformanceTracingEnabled ) {
4346 $ jsFile = 'bundle.tracing.replay.min.js ' ;
@@ -52,8 +55,12 @@ public function onRender(StorefrontRenderEvent $event): void
5255 return ;
5356 }
5457
55- $ replaySample = $ this ->container ->getParameter ('frosh_sentry.storefront.replay_recording.sample_rate ' );
56- $ tracingSample = $ this ->container ->getParameter ('frosh_sentry.storefront.tracing.sample_rate ' );
58+ $ replaySample = $ this ->container ->hasParameter ('frosh_sentry.storefront.replay_recording.sample_rate ' )
59+ ? $ this ->container ->getParameter ('frosh_sentry.storefront.replay_recording.sample_rate ' )
60+ : 0.1 ;
61+ $ tracingSample = $ this ->container ->hasParameter ('frosh_sentry.storefront.tracing.sample_rate ' )
62+ ? $ this ->container ->getParameter ('frosh_sentry.storefront.tracing.sample_rate ' )
63+ : 0.1 ;
5764
5865 $ event ->setParameter ('sentry ' , [
5966 'dsn ' => $ this ->sentryOptions ->getDsn (),
0 commit comments