diff --git a/core/profiles/demo_umami/themes/umami/umami.theme b/core/profiles/demo_umami/themes/umami/umami.theme
index 69829548c4..b94fe3bd9f 100644
--- a/core/profiles/demo_umami/themes/umami/umami.theme
+++ b/core/profiles/demo_umami/themes/umami/umami.theme
@@ -63,7 +63,7 @@ function umami_preprocess_breadcrumb(&$variables) {
   // We are creating a variable for the Current Page Title, to allow us to print
   // it after the breadcrumbs loop has run.
   $request = \Drupal::request();
-  if ($route = $request->attributes->get(RouteObjectInterface::ROUTE_OBJECT)) {
+  if ($route = \Drupal::routeMatch()->getRouteObject()) {
     // Search page titles aren't resolved using the title_resolver service - it
     // will always return 'Search' instead of 'Search for [term]', which would
     // give us a breadcrumb of Home >> Search >> Search.
