Commit 78d706c9 authored by mark burdett's avatar mark burdett
Browse files

Issue #3321670 by mfb: Don't throw TypeError if public_dsn is null

parent ddea6cb1
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -45,8 +45,12 @@ class SecKitOverrides implements ConfigFactoryOverrideInterface {
      return $overrides;
    }
    $config = $this->configFactory->get('raven.settings');
    $dsn = empty($_SERVER['SENTRY_DSN']) ? $config->get('public_dsn') : $_SERVER['SENTRY_DSN'];
    if (NULL === $dsn) {
      return $overrides;
    }
    try {
      $dsn = Dsn::createFromString(empty($_SERVER['SENTRY_DSN']) ? $config->get('public_dsn') : $_SERVER['SENTRY_DSN']);
      $dsn = Dsn::createFromString($dsn);
    }
    catch (\InvalidArgumentException $e) {
      // Raven is incorrectly configured.
+5 −1
Original line number Diff line number Diff line
@@ -58,8 +58,12 @@ class CspSubscriber implements EventSubscriberInterface {
    if (!class_exists(Dsn::class)) {
      return;
    }
    $dsn = empty($_SERVER['SENTRY_DSN']) ? $config->get('public_dsn') : $_SERVER['SENTRY_DSN'];
    if (NULL === $dsn) {
      return;
    }
    try {
      $dsn = Dsn::createFromString(empty($_SERVER['SENTRY_DSN']) ? $config->get('public_dsn') : $_SERVER['SENTRY_DSN']);
      $dsn = Dsn::createFromString($dsn);
    }
    catch (\InvalidArgumentException $e) {
      // Raven is incorrectly configured.
+5 −1
Original line number Diff line number Diff line
@@ -60,8 +60,12 @@ class Raven extends ReportingHandlerBase implements ContainerFactoryPluginInterf
      return;
    }
    $config = $this->configFactory->get('raven.settings');
    $dsn = empty($_SERVER['SENTRY_DSN']) ? $config->get('public_dsn') : $_SERVER['SENTRY_DSN'];
    if (NULL === $dsn) {
      return;
    }
    try {
      $dsn = Dsn::createFromString(empty($_SERVER['SENTRY_DSN']) ? $config->get('public_dsn') : $_SERVER['SENTRY_DSN']);
      $dsn = Dsn::createFromString($dsn);
    }
    catch (\InvalidArgumentException $e) {
      // Raven is incorrectly configured.